【问题标题】:jqGrid grouping - hiding the group header and footer when only one rowjqGrid分组-只有一行时隐藏组页眉和页脚
【发布时间】:2012-06-01 09:55:30
【问题描述】:

我在 jqGrid 中使用分组功能。 但是我只想在组中有多个元素时才显示组标题(jqgroup)和组页脚(jqfoot)。

我正在尝试在 loadComplete 回调中使用 JQuery 选择器。 我已经通过检查组标题文本中的项目数成功隐藏了组标题。

groupingView : { 
  ..
  groupText: ['<b>{0}</b> ({1})'],
}

loadComplete: function(data) {     
  // group header text is "value (number of elements)"
  $("#grid tr.jqgroup:contains('(1)')").hide(); 
}

但我找不到正确的选择器来隐藏组摘要行。 例如,我尝试了以下方法:

$("#grid tr.jqgroup:contains('(1)') + .jqfoot")

【问题讨论】:

    标签: jquery jqgrid


    【解决方案1】:

    其实我发现了:“+”运算符给出了真正的下一个元素

    $("#grid tr.jqgroup:contains('(1)') + .jqgrow + .jqfoot").hide();
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-10-22
      • 1970-01-01
      • 2019-08-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-01-29
      相关资源
      最近更新 更多