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

Custom sorting on a grid column

3 Answers 183 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Tom
Top achievements
Rank 1
Tom asked on 16 Jul 2014, 11:57 AM
HI, i have implemented a custom sort on a grid column (coffeescript) like this:

sortable:
  compare: (a, b) ->
    # tech note: this is supposed to work, but the code is never called http://onabai.wordpress.com/2013/09/28/kendoui-grid-custom-sorting-algorithms/
    aName = _.findWhere(Dragon.prefetchData.get('supportingDocuments'), id: a)?.name
    bName = _.findWhere(Dragon.prefetchData.get('supportingDocuments'), id: b)?.name
    if aName > bName then return 1
    if aName < bName then return -1
    return 0

but the compare function is never called - what am i doing wrong?

3 Answers, 1 is accepted

Sort by
0
Nikolay Rusev
Telerik team
answered on 18 Jul 2014, 07:29 AM
Hello Tom,

Custom compare seems to be working here: http://jsbin.com/beyonize/1/edit. You can check the version of the script which you are using as this feature was introduce in more recent versions.

Regards,
Nikolay Rusev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Tom
Top achievements
Rank 1
answered on 21 Jul 2014, 02:19 AM
Hi Nikolay, I'm using Kendo.Web v2013.1.319 - do I need to upgrade?
0
Nikolay Rusev
Telerik team
answered on 21 Jul 2014, 12:42 PM
Hello Tom,

This feature was introduced with Q2 2013 Release which is version 2013.2.716. While you are using Q1 2013 version.

Regards,
Nikolay Rusev
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
Tom
Top achievements
Rank 1
Answers by
Nikolay Rusev
Telerik team
Tom
Top achievements
Rank 1
Share this question
or