Hi,
I want to change the datepicker's display and input format for my date column's filter row in the igGrid. How do you achieve this?
So far I have tried setting dateInputFormat and dateDisplayFormat for columnSettings under filtering but to no avail. I have also tried to change the datepicker format once it has been initialized but I have no Id to retrieve it with (none that seems to get it at least) since it is created by the grid and only linked via a css class.
Any help would be much appreciated!
Best Regards
Fredrik
I'm using IgniteUI 15.2.
This method doesn't seem to work in my version. Is there any other way of modifying the format for the filter row editor?
Also, is it possible to filter a 'date' column on the date AND time? Currently, it only filters on date, even though my column format shows time and the filter row editor uses that same format.
thanks,
wvusaf
Thank you very much Martin!
That fixed my problem!
Hello Fredrik,
This can be achieved, although not from the filtering columnSettings. The idea is to get the reference to the igEditor instance for the date column filter editor and set its dateDisplayFormat and dateInputFormat options. Here is an example code:
$("#grid1").on("igcontrolcreated", function (evt, ui) { $("#grid1>thead>tr>td:eq(5)>span").igEditor("option", "dateDisplayFormat", "dd/MM/yyyy"); $("#grid1>thead>tr>td:eq(5)>span").igEditor("option", "dateInputFormat", "dd/MM/yyyy");});
In this example the index 5 in the jQuery selector indicates the index of the date column in the grid. Note: you should put this code before the grid creation code.
Attached you can find a complete sample.
Hope this helps,Martin PavlovInfragistics, Inc.