JsGrid跳过一行

时间:2018-10-31 14:40:03

标签: javascript jsgrid

我有一个JsGrid实现。在其中,我使用一些itemtemplates进行计算,例如:

 itemTemplate: function(value, item) {
      Total = Total + (item.SomeValue - item.SomeOtherValue);
          return(Total);
      }

有时“总计”为空。在这种情况下,我想跳过完整的行。 有什么办法吗? 现在我结束了很多空行。

谢谢,迈克

1 个答案:

答案 0 :(得分:0)

itemTemplate用于更新行中的单元格。如果要操作行,则必须使用回调函数rowRenderer

rowRenderer: function(item,itemIndex){
    if('condition_to_skip_row'){ return null;}
    return '<h1>1<h1>';
}

有关参考,请遵循jqGrid文档-http://js-grid.com/docs/#configuration