-
20 Jan 2009 2:27 AM #1
Issue With Grid
Issue With Grid
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
-
20 Jan 2009 2:34 AM #2
why you need load, and remove.. if you don't load the data.. post your code
-
20 Jan 2009 3:04 AM #3
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
-
20 Jan 2009 4:35 AM #4
Please post some complete example that i can just compile and run that is demonstrating the issue.
-
20 Jan 2009 4:41 AM #5
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:
Simple proxy method. The trick is in the "myFilter" object.Code:RPCProxy myProxy = new RpcProxy() { @Override public void load(Object loadConfig, AsyncCallback callback) { myRPCService.getData((PagingLoadConfig) loadConfig, myFilter, callback); } };
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?


Reply With Quote