PDA

View Full Version : Load Mask not working in grid panel



JDevloper
29 Jun 2008, 10:41 PM
Hi,

I am using gridpanel with pagingmemory proxy.so i will show only limited records say 15,

this time the component is not coming ie)when i click the paging buttons,also when i refresh

the records using my refresh button that time also load mask not working.

basically my code snippet like this.

in my refresh button action handler:

first line of my handler function


grid1.getGridEl().mask('Loading Data...');


after that i loading a data to a grid

again i am unmasking like this:


grid1.getGridEl().unmask(true);

Based on this problem i have red some of the threads in this forum but still i am not getting clear idea.bcoz all the threads using extend general grid panel into their grid panel and do other things.but my case i am not using extends the general panel instead of that i am using creat object of the grid panel and use it.

can any one briefly give any sample,how it works

Thanks

Animal
29 Jun 2008, 11:04 PM
For how long would you expect to see a mask up there when populating the Grid from memory?

JDevloper
29 Jun 2008, 11:32 PM
Hi,

Ans : until i expect to see the loadmask, proxy fetch current page records.

When i click my refresh button in my grid , i am fetching all records from the server once again (obviously it should take some time )so that time my load mask not coming that's were the real problem.

Animal
30 Jun 2008, 12:18 AM
OK, we need to see more code. You are running in Firefox with Firebug are you?

JDevloper
30 Jun 2008, 2:07 AM
Hi,

This is the code,i am using fire bug only but cannot able to identify where i have done the mistake.




var refreshButton =new Ext.Toolbar.Button({icon: 'url', cls: 'x-btn-icon',id: 'Refresh'],
handler:function Refresh(){

grid.getGridEl().mask('Loading ...');
//calling server side

BackingBean.getRefreshData ({callback:setProxyData,async:false,errorHandler:serverError,timeout:120000});
}});
grid.getGridEl().unmask(true);

function setProxyData(serverData){

memoryPageProxy.data = Ext.util.JSON.decode(serverData);
jstore.load({params:{start:0, limit:15}});

}



var grid = new Ext.grid.GridPanel({
store:jstore,
cm:colModel ,
height:winHeight,
width: winWidth,
frame:true,
viewConfig: {
forceFit:true,
enableRowBody:true

},

tbar:tbarItems,
sm: rowSelectionModel,
fitContainer:true,
collapsible: true,
plugins: expander,
loadMask: true,
title: titleHeader,
el: 'namediv',
border : true,
bbar: pagingBar


});

grid.render();
jstore.load({params:{start:0, limit:15}});

Animal
30 Jun 2008, 2:21 AM
async:false?

What's BackingBean? Can it do async? I suspect it's returning immediately, and so your grid is being unmasked immediately.

JDevloper
30 Jun 2008, 2:53 AM
Hi,

backingbean is my java class

I removed that async:false attribute. in my function any way still the loadmask not appear
when i refresh the grid.

Thanks

Animal
30 Jun 2008, 2:56 AM
BackingBean? A Java class.

So you are using DWR?

The problem is that Ajax is asynchronous. It's what the "A" stands for.

The unmask is being called immediately because the call returns immediately.

This is what callbacks are for.

JDevloper
30 Jun 2008, 3:05 AM
yes , i am using DWR and fetch the data from the server and set it to proxy.

JDevloper
30 Jun 2008, 3:07 AM
What should i do for this problem,for paging loading mask is coming but fraction of seconds

just like flickering

30 Jun 2008, 3:08 AM
there is a really good us dwr proxy on the board that doesn't require you to manually fire off the mwlwthod to fetch the data cilia DAR. Look for DAR proxy improved in the google search input box on the upper right of this site.

JDevloper
30 Jun 2008, 3:46 AM
i am using the same dwr call for my paging in the grid any way the load mask show's up.but i dont know why it is not happening in refresh time

hendricd
30 Jun 2008, 4:02 AM
grid.loadMask.show();
jstore.load.defer(20,jstore,[{params:{start:0, limit:15}}]);

JDevloper
1 Jul 2008, 12:52 AM
Thanks,i have added those snippets ,it's working fine.