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

sort on hidden column

3 Answers 566 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Guillaume
Top achievements
Rank 1
Guillaume asked on 07 Mar 2016, 07:06 PM

Is there a way to sort on a hidden column instead to the visible column?

I need to sort on a datetime with a specific format but it doesn't work as it's a string

 

thank

3 Answers, 1 is accepted

Sort by
0
Alexander Popov
Telerik team
answered on 09 Mar 2016, 08:45 AM
Hello Guillaume,

Yes, the DataSource can be order by a field of your choice using the sort method.

Regards,
Alexander Popov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Santosh
Top achievements
Rank 1
answered on 19 Jul 2017, 07:56 AM

Hi Alexander,

I want to Sort a date column (which is displaying as string type) with value of other hidden column. As mentioned below

 LastCurDate: { type: "string" },
 dtLastCurDate: { type: "string" }

AND 
                    {
                        field: "dtLastCurDate", title: "Last Current", filterable: { multi: true, dataSource: [{ dtLastCurDate: 'Less than 14 days' }, { dtLastCurDate: 'Between 14 to 30 days' }, { dtLastCurDate: 'More than 30 days ago' }], checkAll: false }, sortable: true,
                        template: "<div class=\"displayInlineBlock\" style='width:140px;'>${LastCurrentDate}</div>"
                    },

0
Konstantin Dikov
Telerik team
answered on 20 Jul 2017, 11:04 AM
Hi Santosh,

I will share the answer from the support ticket for other convenience:

"In order for the values to be sorted as dates you will have to define the type as a date or define custom sorting function as documented in the following help article:
http://docs.telerik.com/kendo-ui/api/javascript/ui/grid#configuration-columns.sortable.compare
"

If other questions arise on this matter we can continue the conversation in the support ticket.


Regards,
Konstantin Dikov
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Grid
Asked by
Guillaume
Top achievements
Rank 1
Answers by
Alexander Popov
Telerik team
Santosh
Top achievements
Rank 1
Konstantin Dikov
Telerik team
Share this question
or