I use cascadeBy function and record.set('checked', checked); to check/uncheck child nodes in Ext JS treepanel. In 4.0.7 and 4.1 version of EXT JS all works fast. But when I upgrade my project to 4.2 version this operation use more then 4 times more time.
Here is example:
http://jsfiddle.net/CaV3n/1/
checkchange: function (record, checked, opts) {
var i=0;
var start=new Date;
record.cascadeBy(function(e) {
i++;
e.set('checked', checked);
});
var stop = new Date;
alert(i +'items '+ (stop-start)+'ms');
}
if i use version 4.2.0 I have 132 items rendered in 2677ms
if I use version 4.1.0 I have 132 items rendered in 735ms
if I use version 4.1.1 I have 132 items rendered in 645ms
How can I improve treepanel speed ?
I would log this in the ExtJS forum as an 'issue/bug'
But to boost performance use suspendLayouts()
checkchange: function (record, checked, opts) {
var i = 0;
var start = new Date();
panel.suspendLayouts();
record.cascadeBy(function (e) {
i++;
e.set('checked', checked);
});
panel.resumeLayouts();
var stop = new Date();
alert(i + 'items ' + (stop - start) + 'ms');
}
Here is a working fiddle:
http://jsfiddle.net/Vandeplas/8Dq2s/
It renders in 1/10 of the time before... more like 60ms!
This method is designed for these 'batch' updates.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With