Hopefully someone can give me some pointers on this one. I'm using UI with Angular, and ran into a problem trying to use the datetimepicker as a column filter. The issue seems to occur when the dataSource is updated via the dataSource.data() method. I've managed to reproduce this in the dojo http://dojo.telerik.com/ELado/3
Strangely if I use the k-rebind attribute and populate the data directly onto the options, the issue doesn't occur, however using k-rebind causes issues with column hiding and sorting - dojo example http://dojo.telerik.com/avOKi
5 Answers, 1 is accepted
Take a look at this updated demo. When you filtered originally, the Kendo DateTimePicker was getting a type error. This is because the dates in your data were actually strings rather than date/time objects.
Here's how I updated it:
Thanks Pat, that's a workaround for sure, but why does it work as intended with the same data when set via k-rebind? The data is coming from an API so obviously I'll need to iterate the data whenever there are date fields, which is a pain.
k-rebind will destroy the original widget, and will recreate it using the changed options. See more details here - Updating widgets when options change
On the other hand when setting data through data method the data items must be of correct type as schema.model configuration will not be used to parse the items as stated in the method description.
Thanks Nikolay, is there a way to persist option changes back to a scope variable when using k-rebind then, so that the recreated widget has any filter/column changes.
There isn't event or similar to track when the k-rebind will trigger. However k-rebind="some property" means that whenever you change that "some property" k-rebind will be executed. That said you can track state (I'm not sure what exactly you mean here) right before touching that option.