PDA

View Full Version : extjs 4 show mask while check/uncheck nodes



frtkpr
25 Oct 2014, 12:28 PM
im trying to check/uncheck specific node and its child nodes as below it is working. Except loading mask. i don't know what is the problem. why not show the mask ?


onTreepanelCheckChange: function(node, checked, eOpts) {
tree.setLoading( 'Wait...' );
node.cascadeBy( function( n ) {
n.set( 'checked', checked );
if( n.data.p_id !== 0 ) n.expand();
} );
tree.setLoading( false );
}I've tried to use tree.suspendLayouts(); before cacadeBy function but result is same

glopes
26 Oct 2014, 5:21 PM
Hi,

You should add a little delay to give time for your mask to show up.




onTreepanelCheckChange: function(node, checked, eOpts) {
tree.mask('Wait...');
Ext.defer(function(){
node.cascadeBy( function( n ) {
n.set( 'checked', checked );
if( n.data.p_id !== 0 ) n.expand();
} );
tree.unmask();
},100);