zoukankan      html  css  js  c++  java
  • Extjs gridPanel 动态指定表头

    var colMArray = new Array();
    colMArray = [{header : "产品代码",    dataIndex : "cpdm",    width : 100},
                {header : "代销机构代码",    dataIndex : "dxjgdm",    width : 100},
                {header : "总份额",    dataIndex : "zfe",    width : 100, align:"right"}         ];
    
    var colQd = new Ext.grid.ColumnModel(colMArray);
    
    
    function selinfo(){
        var cpdm_sel = Ext.get("cpdm").getValue();
        var dxjgdm_sel = Ext.get("dxjgdm").getValue();
        var select_method_sel = Ext.get("cpdm_radio").getValue();
        if(document.getElementById("dxjgdm_radio").checked){
            select_method_sel = Ext.get("dxjgdm_radio").getValue();
            colMArray[0] = {header : "代销机构代码",    dataIndex : "dxjgdm",    width : 100};
            colMArray[1] = {header : "产品代码",    dataIndex : "cpdm",    width : 100};
        }else{
            colMArray[0] = {header : "产品代码",    dataIndex : "cpdm",    width : 100};
            colMArray[1] = {header : "代销机构代码",    dataIndex : "dxjgdm",    width : 100};
        }
        var params = {};
        params.cpdm_sel = cpdm_sel;
        params.dxjgdm_sel = dxjgdm_sel;
        params.select_method_sel = select_method_sel;
        //params.whereStr = " and feetype in ('1','2')";
        storeCpye.baseParams = params;
        colQd = new Ext.grid.ColumnModel(colMArray);
        //gridCpye.reconfigure(storeCpye,colQd),
        storeCpye.load({
            callback : function(r, options, success) {
                if (success == true){
                    gridCpye.reconfigure(storeCpye,colQd);
                }else if (success == false) {
                    Ext.Msg.alert("错误", storeCpye.reader.jsonData.msg);
                }
            }
        });
    }
  • 相关阅读:
    springboot自动装配原理
    @Inherited 注解的作用
    基础知识点:链表反转
    基础知识点:二叉树的层次遍历
    算法题:8、二进制中1的个数
    微服务_GPRC
    扎实基础_数据结构
    .net core3.0程序发布到linux+docker
    c#_安全漏洞总结
    IIS Express(电脑无管理员权限如何启用VS调试)
  • 原文地址:https://www.cnblogs.com/mingforyou/p/3344527.html
Copyright © 2011-2022 走看看