View Full Version : Reload a Grid

2 Sep 2009, 9:13 AM

I am new to GXT, we are exploring replacing our YUI based UI with GXT. We love the widgets and GXT.

I am essentially using the XMLGrid example from the GXT explorer demo (http://www.extjs.com/examples/#xmlgrid). The change i made was to change the proxy URL load data from a REST service that returned XML. So far so good.

I then added a listener to the grid to handle a mouse click which then made a POST to another REST service to make updates.

What I now need to do on POST success, is to reload the entire grid again to reflect the updated status of the record(s), including those that may have been made by other users.

The first call to loader.load() works, but any subsequent call to the loader.load() in response to the user clicks seems to return data cached from the first call.

In fact, it succeeds even if I shut down the REST service!. Hitting the REST url directly correctly returns the updated data, so I have eliminated that possibility.

I have implemented a LoadListener for the Loader and the loaderLoadException method is never invoked.


2 Sep 2009, 9:39 AM
look here:

RequestBuilder builder = new RequestBuilder(RequestBuilder.GET,
builder.setHeader("Cache-Control", "no-cache");


RequestBuilder rb = new RequestBuilder(RequestBuilder.GET,
"../loginUtil.jsp?action=getInitData&rnd=" + new Date().getTime());

2 Sep 2009, 10:13 AM
Well, that was quick.

Your tip ( the first one ) solved the problem.

I suspected as much, but I was thrown off track because the Hosted mode browser ( IE) was having the problem and I didn't think of trying it out in Firefox. What I did test in Firefox was that the REST service was indeed returning the right data.

We do have caching turned off in the REST service responses, but coincidentally missed it in that particular one.

Thanks for the help.