Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Dave on Jul 03, 2008 09:07
open dhtmlx forum
Using grid.post with enablePaging

Hi,

I am using a gid with paging enabled. When I use grid.loadXML to populate grid the paging works fine with posStart and count available. However, if I use grid.post to populate the grid the paging parameters posStart and count are no longer available ..

Dave
Answer posted by Support on Jul 08, 2008 02:26
The existing logic of dynamical loading, will call grid.load each time when new data need to be fetched.
Basically, if you are loading grid by post - it will work normally except it will use "get" requests to fetch additional data.

You can adjust it in dhtmlxgrid.js , line 5286

    render_dataset:function(min, max){
        ...
            this.load(this.xmlFileUrl....

this.load can be replaced with this.post
Answer posted by Thomas on May 08, 2009 06:08
Hello,

I've got the same problem as Dave, but I don't really want to change your source code. Changes like that make it really hard to upgrade to a newer version of dhtmlxSuite later.
Would it be possible to tell the dhtmlxGrid to use the method "POST" instead of "GET"?
Something like:

grid.enableSmartRendering(true, 400, "post");

Cheers,
Thomas
Answer posted by dhxSupport on May 08, 2009 08:18
Since version 2.0 dhtmlxGrid contains dhtmlxgrid_post.js extension, which adds support for such operations.
http://dhtmlx.com/docs/products/kb/index.shtml?cat=search&page=1&q=3450&ssr=yes&s=post%20extension

Also you should add "onDynXL" event to your grid :
grid.attachEvent("onDynXLS",function(start,count){
  grid.post(url,"start=&"+start+"count="+count);
  return false;
})

Answer posted by Thomas on May 11, 2009 01:43
Thanks a lot!

Works like a charm.

Thomas

PS: The event "onDynXLS" seems not to be in your on-line documentation: http://dhtmlx.com/docs/products/dhtmlxGrid/doc/events.html#grid_api_ev
Answer posted by dhxSupport on May 11, 2009 06:57

>>The event "onDynXLS" seems not to be in your on-line documentation: http://dhtmlx.com/docs/products/dhtmlxGrid/doc/events.html#grid_api_ev

Thank you for your note. That issue will be fixed at the next Dhtmlx documentation version.