Cannot implement custom sorting by column: columns.sortable.compare missing on react implementation #633
Labels
Discussion
Technical discussion, questions, input needed
Enhancement
New feature of an existing functionality or an improvement of an existing functionality
pkg:Grid
I'm submitting a Suggestion for improvement.
I implemeted a Kendo React Grid containing objects with the following structure:
{
createdon: "2020-03-27T16:59:52Z"
createdon_formatted: "3/27/2020 5:59 PM"
id: "91b96a5e-4c70-ea11-80f0-20474790ab5d"
ofs_ruleid: {
Id: "15734fa9-5779-e811-80d6-20474790ab5c"
LogicalName: "ofs_routingrule"
Name: "Validate Individual"
}
ofs_success: false
ofs_success_formatted: "No"
}
One of the columns I defined is using the ofs_ruleid field which is an object, so I implemented the cell property on the Column to use the Id, LogicalName and Name sub properties to create the td tag.
This is working fine, but the problem is that when I try to sort by that field (ofs_ruleid) it doesn't work cause it's an object and not a primitive value like string or dates.
I read that on the JQuery version you can define a compare function on the columns property sortable.compare(https://docs.telerik.com/kendo-ui/api/javascript/ui/grid/configuration/columns.sortable#columnssortablecompare) but this is not abailable on Kendo React Grids.
Is there any workaround for this?
Thanks
The text was updated successfully, but these errors were encountered: