问题
I have a tree panel, data provided by remote service and I update my tree data by node. On first node data load all rendered relatively fast, but if I reload node data child nodes rendered too slowly. This becomes critical with large amount of child elements (1000+).
I use ExtJS 4.2.0.663.
As I understand its a bug in ExtJS - related sencha forum thread.
Simple fiddle from linked forum thread to illustrate issue.
I'm trying to find a fix for my ExtJS version, but to no avail (at the moment I can not upgrade ExtJS).
Any ideas how can I solve this problem?
I guess I can try to compare code of related components in different versions and make changes to my ExtJS files, but it is a laborious task and perhaps some of you already know the solution to this problem.
回答1:
I'm pretty sure it's a problem with layout. as I get this solution must help you.
please try to call treeComponent.suspendLayouts()
on beforexpand
event and treeComponent.resumeLayouts(true)
on afterexpand
event.
if it does not helps try global suspend mechanism:
Ext.suspendLayouts();
...
Ext.resumeLayouts(true);
回答2:
It's a basic problem of the treepanel in Ext4. We using ExtJS on our company products and treepanels have extreme problems with large data coming as child nodes.
You can use the bufferedRenderer plugin on the treepanel to speed up the generation:
plugins: {
ptype: 'bufferedrenderer'
}
Your updated fiddle: http://jsfiddle.net/qczvjrko/5/
Hope it helps.
来源:https://stackoverflow.com/questions/35747961/extjs-ext-tree-panel-slow-rendered-on-repeated-store-load