-
17 Jul 2012 8:22 AM #1
Ext.dataview.DataView creates multiple loadmasks
Ext.dataview.DataView creates multiple loadmasks
Hi,
Say we have a List using a store that remotely loads a lot of records. If I call load on the store and then call load again before the first load has completed the List is never unmasked. The reason for this is that the List creates a new LoadMask instance in onBeforeLoad. When the store's load is called again, the List's onBeforeLoad again creates a new LoadMask. When the store finishes loading the List's mask is removed by calling setMasked(false). This however only removes the last created mask.
This can be fixed by checking if a mask already exists in onBeforeLoad
Code:Ext.override(Ext.dataview.DataView,{ onBeforeLoad: function() { var scrollable = this.getScrollable(); if (scrollable) { scrollable.getScroller().stopAnimation(); } var loadingText = this.getLoadingText(); if (loadingText && !this.getMasked()) { this.setMasked({ xtype: 'loadmask', message: loadingText }); //disable scorlling while it is masked if (scrollable) { scrollable.getScroller().setDisabled(true); } } this.hideEmptyText(); } });
-
17 Jul 2012 9:11 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,599
- Vote Rating
- 434
Thanks for the report. Probably doesn't happen too often but could see it happening.
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
18 Jul 2012 11:30 AM #3
Well, in the app we are building at the moment we are filtering a remote store containing 32k records using a realtime searchbox, every time a char is typed the filter is adjusted and a new load of the store is triggered. When typing fairly fast this happens very often.
-
15 Nov 2012 8:05 AM #4Sencha - Sencha Touch Dev Team
- Join Date
- Mar 2007
- Location
- Haarlem, Netherlands
- Posts
- 1,235
- Vote Rating
- 4
The best way to fix this is to make sure a container can never have two masks. The bug is that in applyMasked in Container we expect the currentMask to be passed as the second argument, which isnt the case for config apply methods (only for the update methods).
The following override will fix your case and all other double mask cases
Thanks for your report.Code:Ext.override('Ext.Container.MaskFix', { override: 'Ext.Container', applyMasked: function(masked) { var isVisible = true, currentMask; if (masked === false) { masked = true; isVisible = false; } currentMask = Ext.factory(masked, Ext.Mask, this.getMasked()); if (currentMask) { this.add(currentMask); currentMask.setHidden(!isVisible); } return currentMask; } });
Success! Looks like we've fixed this one. According to our records the fix was applied for
TOUCH-3138
in
Sprint 28.


Reply With Quote
