PDA

View Full Version : [Solved] Prevent Interaction While Loading.



cluettr
21 Jul 2007, 4:23 PM
When dynamically loading a grid with data I need to prevent the user from doing anything with the grid and other elements throughout the page. Is their a good way to do this?

evant
21 Jul 2007, 5:03 PM
Could just mask the page



Ext.get(document.body).mask();

cluettr
21 Jul 2007, 6:58 PM
Thanks evant!

Sometimes I drink and get really drunk but I swear I haven't had a single drink today : ) With that being said I have one more question for you...

Is it just a matter of either creating the loadMask object or adding the loadMask parameter to the configuration of the grid - OR - must one add the div containers and css to get it to work?

I saw this in the API docs source:


<div id="loading-mask" style="width:100%;height:100%;background:#c3daf9;position:absolute;z-index:20000;left:0;top:0;"> </div>
<div id="loading">
<div class="loading-indicator"><img src="../resources/images/default/grid/loading.gif" style="width:16px;height:16px;" align="absmiddle"> Loading...</div>
</div>

evant
21 Jul 2007, 7:36 PM
If you just want to mask the grid, then use the loadMask parameter.

If you want to mask the whole page, use the code above. If you do that, you'll manually need to unmask it, using


Ext.get(document.body).unmask();

when the grid is loaded.

cluettr
21 Jul 2007, 10:19 PM
You da' man... thanks!