jquery – 扩展jqgrid子网格

前端之家收集整理的这篇文章主要介绍了jquery – 扩展jqgrid子网格前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我有一个有子网格的jqgrid.如何在不必单击加号的情况下展开子网格?

我遇到了$(“#jqgrid_id”).expandSubGridRow(rowId);但我不确定哪个rowId用于扩展子网格.

谢谢.

解决方法

使用$(“#jqgrid_id”).expandSubGridRow(rowId);在网格的onSelectRow事件中.

像这样的东西:

  1. jQuery("#jqgrid_id").jqGrid({
  2. ...
  3. onSelectRow: function(rowId){
  4. $("#jqgrid_id").expandSubGridRow(rowId);
  5. },...
  6. });

编辑:在GridComplete事件上

  1. jQuery("#jqgrid_id").jqGrid({
  2. ...
  3. gridComplete: function(){
  4. var rowIds = $("#jqgrid_id").getDataIDs();
  5. $.each(rowIds,function (index,rowId) {
  6. $("#jqgrid_id").expandSubGridRow(rowId);
  7. });
  8. },...
  9. });

猜你在找的jQuery相关文章