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

Column filter datetimepicker hangs when using dataSource.data(someData)

5 Answers 26 Views
Grid
This is a migrated thread and some comments may be shown as answers.
jreast
Top achievements
Rank 1
jreast asked on 21 Sep 2015, 12:25 PM

Hi,

 H​opefully 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

 Thanks

 Jason

5 Answers, 1 is accepted

Sort by
0
Patrick | Technical Support Engineer, Senior
Telerik team
answered on 21 Sep 2015, 07:00 PM
Hi Jason,

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:
GridCtrl.theData = { 'thumbs':
          [{
                'desc': 'Happy Gilmore',
                'date': new Date('2015-03-16T08:32:03'),
            },
            {
                'desc': 'Billy Madison',
                'date': new Date('2015-03-17T16:42:57'),
            },
            {
                'desc': 'The Wedding Singer',
                'date': new Date('2015-03-31T07:37:21'),
            },
            {
                'desc': 'Happy Gilmore',
                'date': new Date('2015-03-22T06:26:50'),
            },
            {
                'desc': 'Happy Gilmore',
                'date': new Date('2015-03-16T15:42:03'),
            },
            {
                'desc': 'The Waterboy',
                'date': new Date('2015-03-07T09:55:51'),
            },
          ]
        };

Regards,
Pat
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
jreast
Top achievements
Rank 1
answered on 22 Sep 2015, 08:46 AM

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.

Thanks again.

0
Nikolay Rusev
Telerik team
answered on 25 Sep 2015, 06:17 AM

Hello Jason,

 

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.

 

Regards,
Nikolay Rusev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
jreast
Top achievements
Rank 1
answered on 25 Sep 2015, 08:01 AM

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.

 Thanks.

0
Nikolay Rusev
Telerik team
answered on 29 Sep 2015, 06:33 AM

Hello Jason,

 

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.

 

Regards,
Nikolay Rusev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Grid
Asked by
jreast
Top achievements
Rank 1
Answers by
Patrick | Technical Support Engineer, Senior
Telerik team
jreast
Top achievements
Rank 1
Nikolay Rusev
Telerik team
Share this question
or