View Full Version : Issue With Grid
jagadesh
01-20-2009, 04:27 AM
Hi Guys,
When iam Working with the editable grid, i was unable to remove the rows from the grid . my scenerio is there will be some rows available in the editable grid .what i need to do is i should remove all the rows when the page loads. i tried
if(formgrid.getStore().getCount()>0){
formgrid.getStore().removeAll();
}
but it throws a Null Pointer Excception .
can any one sort me out.
thank u,
jagadesh
fother
01-20-2009, 04:34 AM
why you need load, and remove.. if you don't load the data.. post your code
jagadesh
01-20-2009, 05:04 AM
Hi ,
consider that i will click a edit button in my page which opens a grid with rows populated from the data base . now when i go back to the first page and click edit button for second page. then i would go to the same grid .then grid which contains previous data rows should be removed and filled with new data arrived from the database.
thank u,
jagadesh
Please post some complete example that i can just compile and run that is demonstrating the issue.
Michi_de
01-20-2009, 06:41 AM
My approach would be following:
Use stores, binded to loaders. This loaders should use RPC proxy to get data via RPC.
( a good tutorial for this is here: http://christianposta.com/blog/ )
Lets just look at the RPC Proxies method:
RPCProxy myProxy = new RpcProxy() {
@Override
public void load(Object loadConfig, AsyncCallback callback) {
myRPCService.getData((PagingLoadConfig) loadConfig, myFilter, callback);
}
};
Simple proxy method. The trick is in the "myFilter" object.
Just do the following:
save inside the myFilter object, your values to tell the servlet (the one you ask for data) which data we explicitly need. For example you could send through the filter a string value "abcd" and the servlet looks into the database and gives you back all data matching "abcd".
Now you will just need to change the data inside the myFilter and then do the
loader.load();
After this happened, your store gets the new data and the grid is gonna show you the data you asked for.
Its easy...
you have any more questions?
vBulletin® v3.8.4, Copyright ©2000-2010, Jelsoft Enterprises Ltd.