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

Sorting with a calculated model field in the dataSource

2 Answers 118 Views
Grid
This is a migrated thread and some comments may be shown as answers.
DJ
Top achievements
Rank 1
DJ asked on 04 Nov 2016, 09:52 PM

I've created a dojo here to demonstrate my question.

http://dojo.telerik.com/ikArE

When creating a set of functions under schema, model for a datasource and then refereing to them like "field: 'Functionname()'" in the columns for the grid, it appears to load correctly, but attempting to sort on by clicking the column header results in "d.Functionname" is not a function error.

Is this not supported or is there something else wrong?

 

2 Answers, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 08 Nov 2016, 11:32 AM
Hello DJ,

Unfortunately, the demonstrated scenario is not supported as the sorting is done based on a field in the dataSource, but as this calculated field(using values of other fields) is not part of the dataSource, it cannot be successfully sorted.

In this scenario, I can only suggest having this calculated field in the controller and bound its values to the Grid dataSource instance.

Let me know if you need additional information on this matter.

Regards,
Stefan
Telerik by Progress
 
Build rich, delightful, *native* Angular 2 apps with Kendo UI for Angular 2. Try it out today! Kendo UI for Angular 2 (currently in beta) is a jQuery-free toolset, written in TypeScript, designed from the ground up to offer true, native Angular 2 components.
 
0
DJ
Top achievements
Rank 1
answered on 08 Nov 2016, 03:10 PM
Thanks for your time in answering the question.
Tags
Grid
Asked by
DJ
Top achievements
Rank 1
Answers by
Stefan
Telerik team
DJ
Top achievements
Rank 1
Share this question
or