Sravya
Sravya

Reputation: 27

hide row numbers in jqgrid by using column chooser

Iam using column chooser to hide columns, but when iam clikcking hide all columns row numbers are displaying how to hide row numbers also, please anyone help me on this, thanks

this is my code:

 $("#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);

i am using row numbers true option, but i want to hide row numbers when iam clicking hide all in column chooser

Upvotes: 0

Views: 2205

Answers (1)

Oleg
Oleg

Reputation: 221997

You can include the column "rn" created by rownumbers: true in the list of columns visible by columnChooser by executing

$("#list1").jqGrid("setColProp", "rn", {hidedlg: false});

but you create in the way other problems. The column "rn" is special column which you should not move to another position.

If you need to hide the whole grid then I would recommend you to use

$("#list1").closest(".ui-jqgrid").hide();

and show it by

$("#list1").closest(".ui-jqgrid").show();

If you need to hide or make visible only the "rn" column you can use showCol/hideCol. For example

$("#list1").jqGrid("hideCol", "rn");

Upvotes: 2

Related Questions