Custom sort example for MVC wrappers

10 posts, 0 answers
  1. Ron
    Ron avatar
    1 posts
    Member since:
    Apr 2013

    Posted 23 Apr 2014 Link to this post

    I've noticed that we have the option of doing a custom sort here: [url]http://docs.telerik.com/kendo-ui/api/web/grid#configuration-columns.sortable.compare[/url].

    I'm using the MVC wrappers, but cannot figure out the syntax to make it work in my grid, or find an example.  Could you provide me with an example of this functionality using the MVC wrapper?
  2. Dimiter Madjarov
    Admin
    Dimiter Madjarov avatar
    2159 posts

    Posted 25 Apr 2014 Link to this post

    Hello Ron,

    At the moment setting a custom sortable compare function is not possible in the MVC Wrappers. The users of the Kendo UI Web Grid have posted multiple requests for documenting this feature, so we decided to add it to the configuration documentation.

    Please excuse us if this causing any inconvenience.

    Regards,
    Dimiter Madjarov
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. UI for ASP.NET MVC is VS 2017 Ready
  4. Bob
    Bob avatar
    123 posts
    Member since:
    Sep 2012

    Posted 02 Feb 2015 in reply to Dimiter Madjarov Link to this post

    Hi, is this feature planned for an upcoming release yet?

    I need to filter by date, but display and sort by datetime.  This is how our grid sorting worked in Telerik for WebForms, but the feature is absent in this newer product.
  5. Dimiter Madjarov
    Admin
    Dimiter Madjarov avatar
    2159 posts

    Posted 03 Feb 2015 Link to this post

    Hi Bob,


    This feature is not planned for implementation in the MVC wrappers, because even if implemented it won't be able to handle server operations.

    Regards,
    Dimiter Madjarov
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  6. VasVas
    VasVas avatar
    31 posts
    Member since:
    Nov 2012

    Posted 12 Apr 2015 in reply to Dimiter Madjarov Link to this post

    Dear Dimiter,

    As it is not possible to initialize a compare js function when using a MVC Wapper is it possible to add on after the page loads. With js and by calling the kendoGrid object .

    var grid = $("#myGrid").data("kendoGrid);

    grid.columns["ProductiName"].columns.sortable.compare = myfunction or functionfunction(){}

     

    or

     

    grid.columns[0].columns.sortable.compare = myfunction or function(){}

    Yours,

     

    Ariel

     

  7. Dimiter Madjarov
    Admin
    Dimiter Madjarov avatar
    2159 posts

    Posted 13 Apr 2015 Link to this post

    Hello Ariel,

    Setting a compare function for the field, after the widget is initialized is not a supported scenario.

    Regards,
    Dimiter Madjarov
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
  8. VasVas
    VasVas avatar
    31 posts
    Member since:
    Nov 2012

    Posted 14 Apr 2015 in reply to Dimiter Madjarov Link to this post

    Dear Dimiter,

     

    Is there a way to take the grid created by the wrapper cloning it using it to create a new grid with adding the compare functions.

    when I tried to add a compare function to an existing grid it had no affect as you said because it was not done before init stage/

     But if I clone the object add the functions and the re-init the grid using the datasource of the cloned grid will it work?

     

    Yours,

     

    Ariel

  9. Dimiter Madjarov
    Admin
    Dimiter Madjarov avatar
    2159 posts

    Posted 15 Apr 2015 Link to this post

    Hello Ariel,

    Cloning the options won't solve the problem. As a solution for the current case I would suggest you to either use custom binding, as demonstrated in the following documentation page, and sort the data using custom compare function on the server side or use the Kendo UI Web grid.

    Regards,
    Dimiter Madjarov
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
  10. Patrick
    Patrick avatar
    2 posts
    Member since:
    Apr 2014

    Posted 10 Sep in reply to Dimiter Madjarov Link to this post

    Is there any new information on custom sorting for MVC? Unfortunately, I am working with 3 character codes and would A-Z to be followed by AA-AZ, etc. What I get now as you can imagine is A, AA, AB,... AZ, B...Z.
  11. Dimiter Madjarov
    Admin
    Dimiter Madjarov avatar
    2159 posts

    Posted 13 Sep Link to this post

    Hello Patrick,

    The information in the previous answers is still relevant regarding the current case. The feature is not planned to be implemented in the MVC wrappers. The possible workarounds are described in my last post.

    Regards,
    Dimiter Madjarov
    Telerik by Progress
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top
UI for ASP.NET MVC is VS 2017 Ready