|
Title: Server side datagrid - incorret rownumber Post by: vilish on November 13, 2014, 12:16:53 PM Hi, I implemented a Server side easyui-datagrid and everything looks fine except the rownumbers.
my server side java code populates the right data into the grid and using following code, i correct the pagination. $(document).ready(function () { var pager = $('#tt').datagrid('getPager'); if(pgNum.value!='' ){ // pgNum hidden variable tell the which page i am pager.pagination({ pageNumber:pgNum.value, showPageList:false }); }); Now because of rownumbers:true defined in data-options, pagination initializes the row numbers. So although i am on a 3rd (or some other) page and data and pagination showing right numbers, rownumbers are still 1,2,3,......if i click on refresh button, it correct them. Could some jquery expert can help me to correct the problem. I am mainly a java develioper and trying jquery first time. Thank you, Vilish now since Title: Re: Server side datagrid - incorret rownumber Post by: jarry on November 13, 2014, 04:54:27 PM The 'rownumbers' is the built-in functionality in the datagrid component. You do not need to implement it by yourself. Please try the code below:
Code: $('#dg').datagrid({Title: Re: Server side datagrid - incorret rownumber Post by: vilish on November 14, 2014, 12:50:39 PM I know rownumber is there and gets initialed with rownumbers:true defined in data-options.
well i was going to a different page and from there i am supposed to return on the same page on the datagrid page. Well i resolved this after reading many topics on the forum. here to the way to correct the rownumbers $(document).ready(function () { var opts = $('#tt').datagrid('options'); var pager = $('#tt').datagrid('getPager'); if(pgNum.value!='' && pgSize.value!='' ){ // pgNum and pgSize hidden variable tell the which page i am and row count respectively. opts.pageNumber = pgNum.value; opts.pageSize = pgSize.value; pager.pagination({ pageNumber:pgNum.value, showPageList:false }); } }); |