DHTMLXgrid with tree cell pagination

Hi CS,
I have a grid with a tree cell in it. I am trying to load data from server in pages. If let’s say I have 4 pages and user tries to access 4th page directly (without acessing 1,2 &3) grid is loading first page, then second then third and finally fourth. Am I doing something wrong or is this a default behaiour?
Thanks

In case of treegrid - dynamic loading works for it differently than in case of plain grids.
In plain grid - you can switch to page 4 and it will load data only for that page.
In tree grid - it load all items on first level at once, and will load only content of branches, on opening, dynamically.

So if I have 2000 pages of data in tree grid, it is not possible to directly go to last page directly (without loading intermediate page)? It will be a significant performance hit. Can u suggest a different approach?

If you are using static data loading - you can go to the last page without rendering any intermediate pages.

If you are using dynamic loading - you can go to the last page without loading intermediate data in the grid, and with loading but without rendering in case of treegrid.

This is a bug if you ask me. Tree grid user’s will have to wait for significant amount of time in order to wait (to load all intermdeiate rows) of last page of rendering which shouldn’t be necessary. Is there is specific reason (technically) for this behaviour ? May be the following function can be altered (which is using sequential kind of rowsBuffer) to get to the specific page without loading other rows.

dhtmlXGridObject.prototype._h2_to_buff = function(top) {
if(!top) {
top = this._h2.get[0];
this.rowsBuffer = new dhtmlxArray();
}
;
for( var i = 0; i < top.childs.length; i++) {
this.rowsBuffer.push(top.childs[i].buff);
if(top.childs[i].state == “minus”)
this._h2_to_buff(top.childs[i]);
}
};

Added my own trick to fix this >>

dhtmlXGridObject.prototype._h2_to_buff = function(top){
var idx = (this.pagingOn) ? Math.max(0,(this.currentPage-1)*this.rowsBufferOutSize): this.rowsBuffer.length;
var buff = this._h2_to_sequentialbuff(top);
for(var i = 0; i < buff.length; ++i) {
this.rowsBuffer[idx++] =buff[i];
}
};

dhtmlXGridObject.prototype._h2_to_sequentialbuff = function(top, buff) {
if(!top) {
top = this._h2.get[0];
buff = new dhtmlxArray();
};
for( var i = 0; i < top.childs.length; i++) {
buff.push(top.childs[i].buff);
if(top.childs[i].state == “minus”)
this._h2_to_sequentialbuff(top.childs[i],buff);
}
return buff;
};