Hi Folks,
I am trying to implement your grid using dynamic paging with the toolbar paging style. Needless to say, I’m having a heck of a time.
When I attach the onBeforePageChanged callback, I am having some interesting problems. My intention is to capture the page that the user wants to go to (because I need to add/modify some parameters in the URL, however, the event fires twice.
I’m using the toolbar option of the grid’s paging options
Workflow:
I load up the grid with data using loadXML call with a webpage (the webpage is returning the correct data), I know this because I’m using Fiddler.
The first time it fires my callback, and I’ve clicked Page 5 from the dropdown, the first parameter has 1 for a value, the second parameter has 5 for a value. This first call is generated from _pgn_createToolBar method of the dhtmlXGridObject.
Then, my callback is called again, and the first parameter has 5 for a value, and the second parameter has 1 for a value. This second call is generated from the clearAll method of the dhtmlXGridObject. Which was called from _parseHead method of dhtmlXGridObject, which was called from _process_xml method of dhtmlXGridObject, etc. etc. etc.
Now, if I put a condition around the code in the onBeforePageChanged callback, like so:
if (this.currentPage > 1) {
// modify the url and set this.xmlFileUrl = to the modified url
}
I have to select the page twice in a row to get the data to show…
I can’t get the grid to perform correctly, and I can’t use this control unless I can get past this, and I’ve been chasing this for two days. Please help.