selection is retained after change of data grid

1193
3
Jump to solution
05-11-2016 07:55 AM
ADITYAKUMAR1
Occasional Contributor III


Hi Users,

I have a data grid and I am using Query task to perform query.

I have changed the grid to enhanced grid so that I can get check box there.

The issue I am facing is whenever I perform a query the data gets populated, and suppose I select second and third row in grid after this I perform another query the data will get changed but selection will remain same.i.e for the new result also 2nd and 3rd row will be selected by default.

Any Idea why the selection is not getting removed during data change.

Thanks

Aditya Kumar

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
KenBuja
MVP Esteemed Contributor

Can you use the clearSelection method on the grid when you change the store?

dgrid/Selection.md at dev-0.3 · SitePen/dgrid · GitHub

View solution in original post

3 Replies
thejuskambi
Occasional Contributor III

Can you share you code or ut it on jsBin?

0 Kudos
KenBuja
MVP Esteemed Contributor

Can you use the clearSelection method on the grid when you change the store?

dgrid/Selection.md at dev-0.3 · SitePen/dgrid · GitHub

ADITYAKUMAR1
Occasional Contributor III

if (grid.selection.selectedIndex >0)

    {

        grid.selection.clear();

        grid.selection.addToSelection(newItemIndex);

        grid.selection.getFirstSelected();

    }

0 Kudos