2016-03-30 11 views

回答

0

给一些id空白行说-1。 在加载之前,在LoadComplete函数检查空白行ID是否存在。

0

可以排序之前,然后排序删除最后一个空白行。这里是我的代码,请让我知道如果它解决你的问题。

/* button Click */ 
$('.yourButton').click(function(){ 

     /* get all rows */ 
     var row = $('#jqxgrid').actGrid('getrows'); 

     /* get the last row */ 
     var datarow = $("#jqxgrid").actGrid('getrowdata', row.length-1); 
     if(datarow.Id){ /* check weather last row is blank or not */ 
      /* if blank then delete */ 
      $('#jqxgrid').actGrid('deleterow', row.length-1); 
     }  
     /* sort the gris */ 
     $("#jqxgrid").actGrid('sortby', 'FieldName', 'desc'); 

}); 
相关问题