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

grid sort event

3 Answers 1409 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Dominik
Top achievements
Rank 1
Dominik asked on 16 Nov 2015, 07:20 PM
What is the recommended approach to subscribe to when the grid is sorted or unsorted?

3 Answers, 1 is accepted

Sort by
0
Viktor Tachev
Telerik team
answered on 17 Nov 2015, 09:31 AM
Hello Dominik,

If you would like to implement custom logic after a column in the grid is sorted you can use the dataBound event.

Check out the following dojo example that illustrates the approach.



Regards,
Viktor Tachev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Dominik
Top achievements
Rank 1
answered on 17 Nov 2015, 07:04 PM

Here is how I am doing it: 

 

dataBound: function (e) {
                        if (dataSource.sort() && dataSource.sort().length > 0) {
                            alert(JSON.stringify(dataSource.sort()));
                        }
         
                    }

0
Viktor Tachev
Telerik team
answered on 18 Nov 2015, 12:44 PM
Hi Dominik,

Indeed using this approach you can determine if the data is sorted. In addition you can retrieve the field and the sort order.

Regards,
Viktor Tachev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Grid
Asked by
Dominik
Top achievements
Rank 1
Answers by
Viktor Tachev
Telerik team
Dominik
Top achievements
Rank 1
Share this question
or