Set rownumbers to false dynamically in jqgrid

后端 未结 1 1050
自闭症患者
自闭症患者 2021-01-27 13:39

I like to show row numbers in my grid using the rownumbers property. But if only one row is returned, is there a way to set rownumbers to false dynami

相关标签:
1条回答
  • 2021-01-27 14:26

    You can try to hide the 'rn' columns, which hold the record numbers, if the number of records not large enough. Something like

    loadComplete: function () {
        if ($(this).jqGrid('getGridParam', 'records') <= 1) { // this.p.records
            $(this).jqGrid('hideCol', 'rn');
        } else {
            // show previous hidden column
            $(this).jqGrid('showCol', 'rn');
        }
    }
    
    0 讨论(0)
提交回复
热议问题