Clear selected record in List grid smartgwt

520 views Asked by At

I have a list grid which displaying records retrieve from Rest data source. When I reset the list grid it clear all records from list grid. But already selected record remains same. My need is, the selected record should not remain selected after reset. I have tried invalidatecache, redraw, setData. But nothing works.Any suggestions ?

1

There are 1 answers

1
Alan On

I think this method should work.

listGrid.deselectRecord(record);

So you could do something like this:

listGrid.deselectRecord(listGrid.getSelectedRecord());

Or if that doesn't work you could try selecting the first record in the grid with:

listGrid.selectRecord(0);