`

extjs动态改变 grid column Header属性

 
阅读更多

<ext:component layout="form" columnWidth=".25" defaultType="textfield" labelWidth="35">
                   <ext:combbox  name="dimLevel" fieldLabel="范围:" defaultValue="PRODUCT_STORE" width="100"
                     dataArray="<%=dimLevelStr %>">
                   </ext:combbox>
                </ext:component>

<ext:panel id="productSalesInfoPanel" name="productSalesInfoPanel" region="center" layout="fit" bodyStyle="padding:10px;">
  <ext:fieldSet id="productSalesInfoSet" name="productSalesInfoSet" title="报表信息" layout="fit">
   <ext:grid action="/ccbs/report/ccbsShowReport.do?method=queryProductSalesList"
    name="couponDataGrid" id="couponDataGrid" height="300" withCheckBox="true" paging="true" autoScroll="true">
    <ext:column width="100" header="门店" dataIndex="SHOW_NAME" ></ext:column>
   </ext:grid>
  </ext:fieldSet>
 </ext:panel>

 //grid加载数据
function onready(){
couponDataGrid.getStore().load();
dimLevel.on("select",dimLevelClick);
 }
 
 //根据combbox中的值改变grid中的列标题
 function dimLevelClick(){
    //dimLevel.value;//value ext 获取combbox的值
    //dimLevel.getValue();//getValue() ext 获取combbox的值
    //dimLevel.getRawValue();//getRawValue() ext 获取combbox中的文本
    var dimLevelText=dimLevel.getRawValue();
    couponDataGrid.getColumnModel().setColumnHeader(1,dimLevelText);//修改grid中指定下标的文本值
 }

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics