How to handle multiple LoadMask in Extjs?
I'm doin开发者_高级运维g multi-load in one Window (form load and grid data).
This is my logic,- Start with do mask when Window open.
- Add mask-counter in form load and grid load callback.
- When mask-counter equal 2, unmask.
Do you have better idea ?
Thanks.you can also use this logic:
form.beforeLoad( form.loading = true, if ( not grid.loading ) mask )
grid.beforeLoad( grid.loading = true, if ( not form.loading ) mask )
form.onLoad( form.loading = false, if ( not grid.loading ) unmask )
grid.onLoad( grid.loading = false, if ( not form.loading ) unmask )
this will sync loaders.
by the way, you can also use Ext.Msg.wait, that'll bring a modal dialog without any buttons and wait until you call hide event.
精彩评论