6 Answers, 1 is accepted
My question is if we use value(null) why isn't the date data really set to null ? There is always a date in the datepicker no matter what i do.
I have created a JS Bin sample that introduces the problem i am mentioning. When pressing the "Clear" button in the calendar the only thing that happens is setting the date to the current date.
JS Bin Datepicker
So is there something wrong i am doing here or is there any other workaround to set
the datepicker value to null ?
The value(null) method clears the selected value. The footer template actually allows to define the content of the Today button. You can achieve your goal using setTimeout function. Check the updated jsBin demo.
the Telerik team
Unfortunately i have some issues on the datepickers that are inside a grid. I do replace the datepicker with an editor in the grid "editor: alterDate" and generate the following code for each date field inside the grid.
With the above scenario, although the setDateToNull function works well with a datepicker that is not inside the grid, when i try to set a datefield to null in the grid, kendo ends up setting again the current date.
Is there an extra workaround for this scenarion ?
Thank you in advance
The Grid's editing uses MVVM which expects from the widget to raise change event when value changes. In this case you will need to trigger change manually, because value method does not raise change event:
Thank you very much Georgi.