Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Geoff Walker on Apr 05, 2009 19:10
open dhtmlx forum
SmartRendering wth TreeGrid

I am using a TreeGrid and trying to implement smart rendering in the same way I have done so in the past with your Grid component, but it doesn't seem to be working.

In the javascript I have...
...
treegrid.init();
treegrid.enableSmartRendering(true,50);
treegridURL = "loadGrid.do";
loadXML(treegridURL);

The action then selects the first 50 records from the database and builds the XML beginning with...
<?xml version='1.0' encoding='ISO-8859-15' ?><rows total_count='4959' pos='0'>

The TreeGrid displays just fine, but when I scroll down to the bottom, another call to the action never takes place to get the next 50 rows. As I said, these methods work without any trouble when I have implemented a plain dhtmlxGrid.

I am using pro version 2.1 and the documentation seems to imply that these SmartRendering methods should work with a TreeGrid. Do I misunderstand your documentation, or is there something wrong with my code?

Thank You.
Answer posted by Support on Apr 06, 2009 02:10

TreeGrid supports smart-rendering, but only its static implementation - when all data loaded at once  

Dynamic smart rendering loading in treegrid requires a rather complicated calculation and data interchange protocol - because data from different levels of tree can be required for each scroll state change. It was too complicated to be usable. 

In same time grid support static smart rendering and dynamic branch loading - so you can load first level at start and any sub-levels dynamically, when they opened. 

Answer posted by Geoff Walker on Apr 06, 2009 04:51

Is there some way I can modify your source code to make this work?  The application we are writing allows the user to pick a tree hierarchy to display their data.  No matter what tree they choose, there will only be one level of the treegrid that displays data in columns beyond the tree column and if this level happens to be the top level, there is potentially 50,000 records at this level. 

For example, let's say that level 'C' is the level with multiple columns and 'A', 'B', and 'D' only show data in the 'tree' column.

In most scenarios, dynamic loading is good enough because the tree hierarchy is A, B, C, D.  When the treegrid is like this, C is filtered down to only those items that belong to B (A , B and D are small sets), so no smart rendering is needed, but one hierarchy that can be chosen is to just show C and D.  In this case C will not be filtered by a higher node and could have 50,000+ items.

I will see how all of this works using static smart rendering, but I doubt it's going to work very well.

Any ideas would be appreciated!

Thanks.

 

Answer posted by Support on Apr 06, 2009 09:14
>>I will see how all of this works using static smart rendering
The main problem of static srnd in such scenario - big amount of data which need to be fetched from server. Rendering performance must not be really bad. 

>>Is there some way I can modify your source code to make this work?
Unfortunately it is not so simple. In plain mode grid uses simple model, while with treegrid - it uses more complex approach ( multilevel hierarchy , changes in which affect plain representation ) It will require quite complex code changes to support smart rendering and treegrid in same time. 

We have plans to extended existing functionality of dhtmlxTreeGrid to allow such mix of modes. If you interested in beta code - you can contact us directly at support@dhtmlx.com