【问题标题】:Set rownumbers to false dynamically in jqgrid在 jqgrid 中动态地将行号设置为 false
【发布时间】:2012-03-16 15:56:01
【问题描述】:

我喜欢使用rownumbers 属性在我的网格中显示行号。但是如果只返回一行,有没有办法将rownumbers 动态设置为false。为什么?乍一看,在没有标题的列中看到“1”有点令人困惑。但如果有多行,那么您很快就会意识到该列的用途。

【问题讨论】:

    标签: jqgrid


    【解决方案1】:

    如果记录数不够大,您可以尝试隐藏保存记录号的'rn' 列。类似的东西

    loadComplete: function () {
        if ($(this).jqGrid('getGridParam', 'records') <= 1) { // this.p.records
            $(this).jqGrid('hideCol', 'rn');
        } else {
            // show previous hidden column
            $(this).jqGrid('showCol', 'rn');
        }
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-01-30
      • 2011-06-10
      • 2023-01-02
      • 2018-03-15
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多