列名未隐藏在jqgrid中

时间:2014-09-08 10:12:01

标签: jquery jqgrid

我正在使用列选择器值隐藏但使用此代码时未隐藏列名  我的代码:

$("#list1").jqGrid({
        url:"./controllers/apGetTestData.php?testanzres=1&testsuite="+testsuite+"&testcase="+testcase+"&ch="+ch+,  
        datatype: 'xml', 
        mtype: 'GET', 
        height: 'auto',
        colNames:[ 'RRID', 'Release Tag','Completed Date'],
        colModel:[
                 {name:'idreleaseRequest', index:'idreleaseRequest', width:24},
                 {name:'releaseRequestTag', index:'releaseRequestTag'},
                 {name:'timeStamp', index:'timeStamp'},
                 {name:'DateInfo', index:'Date Info', sortable:false,align:'center'}
                 ],       
        pager: $('#pager1'), 
        rowNum:6, 
        rowList:[6,12,18,24],
        sortname: 'timeStamp',
        sortorder: "ASC",
        caption:"Test Results",
        shrinkToFit:true,
        autowidth: true,
        viewrecords: true,
        rownumbers:true,
        cloneToTop:true,
        toppager:true
     }).trigger("reloadGrid");
         $("#list1").jqGrid('navGrid', '#pager1',{add: false, edit: false, del: false, search: false,  
              cloneToTop:true,refresh: false});
              $.extend(true, $.ui.multiselect, {
                        locale: {
                            addAll: 'Make all visible',
                            removeAll: 'Hide All',
                            itemsCount: 'Avlialble Columns'
                        }
                    });
                    $.extend(true, $.jgrid.col, {
                        width: 450,
                        modal: true,
                        msel_opts: {dividerLocation: 0.5},
                        dialog_opts: {
                            minWidth: 470,
                            show: 'blind',
                            hide: 'explode'
                        }
                    });
                    $("#list1").jqGrid('navButtonAdd',$('#list1')[0].id + '_toppager_left', {
                        caption: "Customize Columns",
                        buttonicon: "ui-icon-calculator",
                        title: "Customize Columns",
                        onClickButton: function () {

                        }
                    });
              var topPagerDiv = $(('#list1')[0] .id+ '_toppager')[0];         

              $(('#list1') + "_toppager_center", topPagerDiv).remove(); 
              $(('#list1') + "_toppager_right", topPagerDiv).remove();        

              $("table.ui-jqgrid-htable thead").appendTo("table#list1");
              $("table#list1 thead tr").addClass('floatingHeaderRow');
              $("div.ui-jqgrid-bdiv").width($(window).width()+30);

我希望网格表标题应该根据表内容记录的宽度显示,并且我希望在使用columnchooser选项后隐藏表列名称。 拜托,有人帮我这个,谢谢。

0 个答案:

没有答案