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

Custom sort example for MVC wrappers

9 Answers 976 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ron
Top achievements
Rank 1
Iron
Iron
Ron asked on 23 Apr 2014, 07:13 PM
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?

9 Answers, 1 is accepted

Sort by
0
Dimiter Madjarov
Telerik team
answered on 25 Apr 2014, 02:22 PM
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.

 
0
Bob
Top achievements
Rank 1
answered on 02 Feb 2015, 02:59 PM
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.
0
Dimiter Madjarov
Telerik team
answered on 03 Feb 2015, 03:30 PM
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.

 
0
VasVas
Top achievements
Rank 1
answered on 12 Apr 2015, 03:46 PM

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

 

0
Dimiter Madjarov
Telerik team
answered on 13 Apr 2015, 01:54 PM

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.

 
0
VasVas
Top achievements
Rank 1
answered on 14 Apr 2015, 06:08 AM

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

0
Dimiter Madjarov
Telerik team
answered on 15 Apr 2015, 09:32 AM

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.

 
0
Patrick
Top achievements
Rank 1
answered on 10 Sep 2016, 05:38 AM
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.
0
Dimiter Madjarov
Telerik team
answered on 13 Sep 2016, 07:32 AM

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
Tags
Grid
Asked by
Ron
Top achievements
Rank 1
Iron
Iron
Answers by
Dimiter Madjarov
Telerik team
Bob
Top achievements
Rank 1
VasVas
Top achievements
Rank 1
Patrick
Top achievements
Rank 1
Share this question
or