Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Allen on Jan 15, 2009 11:38
open dhtmlx forum
Grid: First page not sending parameters; and paging controls not very standard, want to customize them


Trying to use grid (Pro version) in paging mode:

function buildTableX() {
    var srcURL = "../../agents/c2/agent_c2picklist_json.php?";
    var pageSize = 5;
    mygrid = new dhtmlXGridObject('div_gridbox');
    var js_dhtmlxGridCodebase = "../../Vendors/dhtmlx/dhtmlxGrid/codebase/";
    mygrid.imgURL = js_dhtmlxGridImgs;
    mygrid.setHeader("Site, ID, Switch, Unid");
    mygrid.setInitWidths("200,80,200,200");
    mygrid.setColAlign("left,center,center,left");
    mygrid.setColTypes("ro,ro,ro,ro");
    mygrid.setColSorting("str,str,str,str");
    mygrid.init();
    //mygrid.enableSmartRendering(true, pageSize);
    mygrid.enablePaging(true,pageSize,null,"div_pagingArea",true,"div_recinfoArea");
    mygrid.setPagingSkin("bricks");
    mygrid.load(srcURL, "json");
}


When the function is called it sends the request_uri of: "/c2/agents/c2/agent_c2picklist_json.php?" (query_string, _GET, and _POST are all blank) with neither paging parameters sent.
If I click on the page 2, button, the request_uri is: "/c2/agents/c2/agent_c2picklist_json.php?&posStart=50&count=5" which looks correct.

How can I make sure the first request sends the query_string parameters?


Now, problem two: Can I customize the paging controls?

What I would like is "<< < 4 5 6 (7) 8 9 10 > >>"

Where the buttons are: first, prev page, n-3, n-2, n-1, n (current, unclickable), n+1, n+2, n+3, next page, last


Finally, does smart rendering help me in this configuration? Can I enable it?


Answer posted by Support on Jan 16, 2009 04:20
>>How can I make sure the first request sends the query_string parameters?
The first request is exactly the one as specified in loadXML command ( srcURL )
If necessary you can use 
  mygrid.load(srcURL+"&posStart=0&count=5", "json");
  mygrid.xmlFileUrl=srcURL;

>>Now, problem two: Can I customize the paging controls?
http://dhtmlx.com/docs/products/dhtmlxGrid/doc/articles/Custom_paging.html#grid_art_custpaging
>>What I would like is 
Can be done through custom paging skin creation

>>Finally, does smart rendering help me in this configuration? Can I enable it?
Paging and SmartRendering are mutual exclusive, paging already provides same buffering and caching capabilities so usage of smart rendering will not add any benefits.