PDA

View Full Version : loader and treetable - help



fother
26 Jan 2009, 3:45 AM
if you add this code in the class com.extjs.gxt.samples.client.examples.tree.TreeTableExample



loader.addListener(Loader.BeforeLoad, new Listener<BaseEvent>() {

public void handleEvent(BaseEvent be) {

if (table.el() != null) {
table.el().mask(GXT.MESSAGES.loadMask_msg());
}

}

});

loader.addListener(Loader.Load, new Listener<BaseEvent>() {

public void handleEvent(BaseEvent be) {

if (table.el() != null) {
table.el().unmask();
}

}

});


you can see that the mask disappears before that the data render in the treetable..
have other way to do this?

sven
26 Jan 2009, 3:54 AM
You know that both listeners are for the BeforeLoad event?

fother
26 Jan 2009, 3:59 AM
fix the code

fother
26 Jan 2009, 4:07 AM
the listener are correct.. the problem is that the mask disappear before the data appears on grid.. and I needed one code that supply this.

sven
26 Jan 2009, 4:18 AM
With that event it is quite normal that the mask disappears to ealry as when loading is ready it is not rendered. Listen to some other events or delay the unmask.

fother
26 Jan 2009, 4:23 AM
delay the unmask is not a good way to implement.. but the some other events is a good idea.. exist any lister like "when data was rendered"??

sven
26 Jan 2009, 4:29 AM
Why not this method?

http://extjs.com/deploy/gxtdocs/com/extjs/gxt/ui/client/binder/StoreBinder.html#setMask(boolean)

fother
26 Jan 2009, 4:34 AM
thanks :)