How to invalid cache when using ListGrid and Datasource

3.3k Views Asked by At

As per what I found reading other sites :

SmartGWT uses data caching to optimize client-server connections and reduce network traffic. In your example, let's say you have the following in your database:

one word

two words

one sentence

When you type word, the fetch returns:

one word

two words

These values are cached in your client.

When you add one to word, because this is a more restraining search criteria, no need to server fetch, only client filter and the result is:

one word

Is there a way of avoiding this and make the search always against the server?

2

There are 2 best solutions below

0
On

You can user the following properties of DataSource to turn caching OFF.

dataSource.setCacheAllData(false);
dataSource.setAutoCacheAllData(false);

If you want to turn the caching On, pass "true" to both function calls.

0
On

manually calling invalidateCache() on listgrid component should run the fetch method with actual criteria