Answered: Tree taking long time in loading when records exceeds 200 count
Answered: Tree taking long time in loading when records exceeds 200 count
Hi
We are using Ext Tree in our project . We observered that whenever the record counts increases 200 count, tree takes long time in rendering . Data from the server comes in around max 1 sec but rendering of the tree takes more than 20-25 secs.
I am posting below the code we have been using in our project . I would request you to review my code and help us in knowing what wrong is happening.[
code]
Ext.define('treeNode', {
extend: 'Ext.data.Model',
fields: [
{ name: 'id', type: 'string' },
{ name: 'text', type: 'string' },
{ name: 'code', type: 'string' },
{ name: 'nodeType', type: 'string' },
{ name: 'qtip', type: 'string' }
]
});
I have found the problem. Problem is in the line
root: {
expanded: true
}
with root expanded setting, tree loads the next level data also BUT- It loades next level data in non batchupdate mode and thus takes a lot of time specially in getHeight method(extjs calls internally) which tree calls for each node.
If I keep root node expanded false and expand programatically my root node and in after render event ( afterrender:function (tree) {tree.getRootNode().expand();) then tree loads next level data in batchupdate mode and loads the tree in less than 1 sec.
If I am unclear let me know. I would try to explain more. rest extjs people can make us understand.
Might be something else - does the render time change with the timout set in the proxy, if you set it to 10000 for example is the render time redubced to about 10 seconds? If you set "Autoload" for the store does it render fast then?
I have found the problem. Problem is in the line
root: {
expanded: true
}
with root expanded setting, tree loads the next level data also BUT- It loades next level data in non batchupdate mode and thus takes a lot of time specially in getHeight method(extjs calls internally) which tree calls for each node.
If I keep root node expanded false and expand programatically my root node and in after render event ( afterrender:function (tree) {tree.getRootNode().expand();) then tree loads next level data in batchupdate mode and loads the tree in less than 1 sec.
If I am unclear let me know. I would try to explain more. rest extjs people can make us understand.
Well done, and thank you for letting us know. Nested lists are powerful but they have a log of quirks - I spend more time on them than almost anything!