PDA

View Full Version : How to give loadMask in Tree and DataView?



dev_java
8 Sep 2010, 5:06 AM
Hi,


I am using Ext.tree.TreePanel. The data for the tree is retrieved from the DB and it take few seconds to do it. So i want to show some load mask text, say 'Loading...' to be displayed, when tree data is loading from DB.

The same issue is there for Ext.DataView. I tried giving loadMask. But it dint work out.

Is it possible to show such mask text in Tree & Data view?

Thanks

Condor
8 Sep 2010, 5:24 AM
For a DataView you can create a LoadMask, but this only works when the dataview has a fixed height (the loadmask won't show it the dataview is initially height:0).

A tree already shows a loading indicator on the node that is expanding.

dev_java
8 Sep 2010, 10:32 PM
Hi,

I have given fixed height for DataView , loadMask dint work out.

Code:


myDataView = new Ext.DataView({
id: 'my_DataView'
,height:530
,store: dataStore
,tpl: tpl
,multiSelect: true
,overClass: 'x-view-over'
,itemSelector: 'div.thumb-wrap'
,emptyText: '<span style="font-size:12px; font-weight: bold; margin: 25em;"> No data to display. <span>'
,loadMask:{
msg:'Loading Data...'
}
});


Is there any thing else , i have to configure to show the loadMask message?

Thanks

steffenk
9 Sep 2010, 12:06 AM
mask the panel where the dataview is in.

Condor
9 Sep 2010, 12:12 AM
DataView has no loadMask config option. You will have to create a LoadMask instance yourself in the render listener.

dev_java
12 Sep 2010, 1:04 AM
I tried giving wait message in render listener and it worked fine. But i still had a problem. I am not able to recognize the event after the store is being loaded. If i can get some store event like after load, i can dispose the wait window after the store is being loaded.
Is there any way to recognize that store is being loaded?

dev_java
12 Sep 2010, 2:33 AM
I found the solution.The callback is called after the load event is fired.

Thanks