My paging works only on the client side. The grid should send posStart and count parameters in a request but it doesn not. The grid loads all data in the first request.
[code]
var gridQString = "/Projekt/GetGrid";
var mygrid = new dhtmlXGridObject('products_grid');
mygrid.setImagePath("<%= Url.Content("~/content/dhtmlx/imgs/") %>");
mygrid.setHeader("Id,Nazov,Oz,Datum");
mygrid.setInitWidths("50,*,100,100");
mygrid.setColAlign("center,left,center,center");
mygrid.setColSorting("server,server,server,server");
mygrid.setSkin("dhx_skyblue");
mygrid.setColTypes("ro,ro,ro,ro");
mygrid.enableColumnMove(true);
mygrid.attachEvent("onBeforeSorting",sortGridOnServer);
mygrid.attachHeader("#text_search,#text_search,#text_search,#text_search");
mygrid.init();
mygrid.enablePaging(true, 10, 5, "pagingArea", true, "infoArea");
mygrid.setPagingSkin("bricks");
mygrid.load(gridQString,"json");
function sortGridOnServer(ind,gridObj,direct){
mygrid.clearAll();
mygrid.load(gridQString+(gridQString.indexOf("?")>=0?"&":"?")+"orderby="+ind+"&direct="+direct,"json");
mygrid.setSortImgState(true,ind,direct);
return false;
}
</script>[/code]
Your client side is correct. If you can find example of server side of this example at your dhtmlxGrid package dhtmlxGrid\samples\14_loading_big_datasets\php\
The grid should send posStart and count parameters in a request but it doesn not
Please check if you have attached dhtmlxgrid_json.js file to your page.
It’s corect. But I Firuged out the paging is working. When I send from the server only 10 records for the first page, the following requests will contain the appropriate parameters for paging. The problem ist with the first request. This request is omiting the piging paramters.