jQuery动态显示和隐藏datagrid中的某一列的方法_jquery_脚本之家

复制代码 代码如下: $.datagrid({
title:’报表统计’, width:1020, height:400, url:”, fitColumns:true,
loadMsg:’正在获取,请稍侯…’, singleSelect:true, nowrap:false,
columns:[[
{field:’REGION_NAME’,title:’分公司’,width:30,align:’center’},
{field:’COUNTY_NAME’,title:’区县’,width:80,align:’center’,editor:’text’},
{field:’AREA_NAME’,title:’网格’,width:80,align:’center’,editor:’text’},
{field:’ORG_NAME’,title:’网点’,width:80,align:’center’},
{field:’TOTAL_NUM’,title:’总业务量’,width:40,align:’center’},
{field:’DH_NUM’,title:’单宽业务量’,width:40,align:’center’},
{field:’RH_NUM’,title:’融合业务量’,width:40,align:’center’},
{field:’YYT_澳门贵宾会娱乐官网,NUM’,title:’营业厅业务量’,width:40,align:’center’},
{field:’QT_NUM’,title:’其他业务量’,width:40,align:’center’} ]],
toolbar:[ ], onDblClickRow: function() { //selected = $.datagrid;
//var index = $.datagrid(‘getRowIndex’, selected); //$.datagrid;
//progress(); //taskPreempte; } }); $.appendTo; var dd = new Date(); var
d1 = dd.getFullYear()+ “-” + + “-1” ; var d2 = dd.getFullYear() + “-” +

  • “-” + dd.getDate() ; $.datebox; // set datebox value $.datebox; // set
    datebox value refreshRpt2; function refreshRpt2(){ var strStatCond =
    “b.region_name”; if.attr{ param.sts = $.attr; alert; }
    param.qryBeginTime =$.datebox; //alert; param.qryEndTime = $.datebox;
    //alert; if!= null && $.attr{ } if!= null && $.attr{ strStatCond +=
    “,c.county_name”; $.datagrid(‘showColumn’, ‘COUNTY_NAME’); }else{
    $.datagrid(‘hideColumn’, ‘COUNTY_NAME’); } if!= null && $.attr{
    strStatCond += “,d.area_name”; $.datagrid(‘showColumn’, ‘AREA_NAME’);
    }else{ $.datagrid(‘hideColumn’, ‘AREA_NAME’); } if!= null && $.attr{
    strStatCond += “,e.org_name”; $.datagrid(‘showColumn’, ‘ORG_NAME’);
    }else{ $.datagrid(‘hideColumn’, ‘ORG_NAME’); } alert; param.statCond =
    strStatCond; param.rptName = “statBusiRpt”; JSBaseCall.execute; }
    //显示记录集 function showResult2{ var
    strJson=data[“defaultJsonString”]; var result=eval; //alert; if
    (result.KEY_JSCALL_RESULT){ if (result.KEY_SERVICE_RES){//成功
    totalRec=result.KEY_TOTAL_REC; var d={“total”:pageShowRec,
    “rows”:result.defaultAList }; $.datagrid; } } }
    比如在“曲县”没数据时表格就不用显示空列了,而是直接将这一列隐藏掉

发表评论

电子邮件地址不会被公开。 必填项已用*标注