This is a migrated thread and some comments may be shown as answers.

How to reapply sort?

1 Answer 527 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Alex
Top achievements
Rank 2
Alex asked on 04 Jun 2012, 11:21 AM
Hi,

My grid is sorted by a numeric column by default and I have two custom commands that change the content of this column so that the elements in the grid are reordered. I call a grid.refresh() whenever the content of this column change and I see that the displayed value are refreshed, but the sort is not reapplied.

How can I reapply the sort programmatically?

Regards,

Alex

1 Answer, 1 is accepted

Sort by
0
Alex
Top achievements
Rank 2
answered on 04 Jun 2012, 01:13 PM
Got it, had to use grid.dataSource.read() as discussed in this post.

Calling refresh() did update the shown data in the grid, but calling a read() on the dataSource does refresh the data and reapply the sort.

Thanks,

Alex
Tags
Grid
Asked by
Alex
Top achievements
Rank 2
Answers by
Alex
Top achievements
Rank 2
Share this question
or