Sorting with a calculated model field in the dataSource

3 posts, 0 answers
  1. DJ
    DJ avatar
    2 posts
    Member since:
    May 2013

    Posted 04 Nov Link to this post

    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. Stefan
    Admin
    Stefan avatar
    272 posts

    Posted 08 Nov Link to this post

    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.
     
  3. Kendo UI is VS 2017 Ready
  4. DJ
    DJ avatar
    2 posts
    Member since:
    May 2013

    Posted 08 Nov in reply to Stefan Link to this post

    Thanks for your time in answering the question.
Back to Top