2016-03-30 17 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'); 

}); 
相關問題