Mozzan
Mozzan

Reputation: 283

Prevent listgrid from refreshing when setting data

I'm writing a webmail-application by using smartgwt.

I'm trying to use auto-search on TextItem.

The TextItem is added a keyup-Handler and go to server side to do sql search every time when user

key-in a word. (I don't use js search because the speed of ie is very slow when doing filtering)

Further more, i use DSResponse.setData to create the listgrid records.

The problem is when setData is called, the grid always has a "loading data" message during the search.

How can i prevent this? Or just like PickListProperties, no "loading data" message, grid show the result without refresh.

Thanks!!

enter image description here

Upvotes: 0

Views: 164

Answers (1)

Kanwaljeet Singh
Kanwaljeet Singh

Reputation: 1225

The message will appear whenever the grid calls the server to retrieve the data.

However you can, get the entire data on load, and whenever the the user keys in a word, just filter the grid by creating a new criteria like this :-

Criteria criteria=new Criteria();
criteria.addCriteria("name",textBox.getValue());
grid.filterData(criteria);

This way the loading message would not appear and also it would save you trips to server.

Upvotes: 1

Related Questions