Select Filter is not sorting in Date order for a dhxCalendar

I’m currently working with a Ver3.0 suite. I have a Grid with a dhxCalendar column type. I also have a ‘select_filter’ on that column type. Within the grid the rows are correctly shown in Date order (…because that’s how the data is received). However the actual ‘filter’ sorts the dates as if they were text fields. e.g. If there are 5 rows in the grid with the following values for the date column:

01/03/17
03/03/17
01/05/17
02/06/17
10/07/17

Then when you click on the ‘select_filter’ the dates are shown in the following order:
01/03/17
01/05/17
02/06/17
03/03/17
10/07/17

I’ve tried setting the filter to strict and to combo but it has made no difference to the sort order when shown in the filter.

Please can you tell me how to get the dates to show correctly sorted within the filter.

Thanks in advance.

Purvez

Unfortunately the filter cannot treat the column values as dates.
The only solution is to sort the options manually using the onCollectValues event:
docs.dhtmlx.com/api__dhtmlxgrid … event.html

Sematik, many thanks for your reply.

OUCH!! (in this case) (:wink: as that is not an easy task in itself…otherwise you guys would have done it for us. LOL!!

Hi Sematik

Please can you tell me how I can get access to the values within the filter from inside the onCollectValues event.

Thanks

Purvez

I apologize for the delay. You may try to use the collectValues() method:
docs.dhtmlx.com/api__dhtmlxgrid … alues.html

Thanks Sematik. I’ll have a go at sorting the dates correctly using the method and then re-introducing them back using the Event.