PDA

View Full Version : How to know the load is finished in a Grid?



lal
25 Oct 2009, 10:15 PM
Hi all,
In a grid I want to set a flag after data has been loaded and grid rendering complete. In my grid, i m rendering some components using GridCellRenderer.Once my gird render complete, I want to set my editflag as false.

I tried like

grid.addListener(Events.ViewReady, new Listener<BaseEvent>() {

public void handleEvent(BaseEvent be) {
editFlag = flase;
}
}) ;
also tried like


loader.addLoadListener(new LoadListener() {
@Override
public void loaderLoad(LoadEvent le) {
super.loaderLoad(le);
//If data loding is finish , need to reset rowEditor flag
if(recordcount==loader.getTotalCount()-1)
{
editFlag = flase;
recordcount=0;
}
recordcount++;
}
});But both are not working for me and editflag is getting false before components rendered .

pls help .
thanks
lal

sven
26 Oct 2009, 4:20 AM
You can use the LoadListener, but put the logic into a DeferredCommand.

lal
26 Oct 2009, 5:26 AM
It worked........ Thank you very much for your valuable suggestion. I was struggling with that issue.. Thanks once again.