kendo-labs / angular-kendo

A project to create a robust set of Angular.js bindings for Kendo UI widgets
474 stars 209 forks source link

An issue with k-ng-model for multiselect (reopening of #379) #382

Closed YonatanKra closed 10 years ago

YonatanKra commented 10 years ago

Hi, Sorry for the last plnkr. Their site had some issues lately. Here is an example based on your example in the Kendo UI Dojo: http://runner.telerik.io/fullscreen/EyuN\

In this example, I k-ng-model to a scope variable, it shows the selection as expected, but no event is fired upon this binding (you can see only dataBound is fired, but it is fired before the selection is "made").

I console.log from dataBound, change and select but the last 2 are not even fired, while the first one fires once, without the selection. Hence, the selected items are being "chosen" after the dataBound event and I have no idea when (I need this to do some tasks upon selection).

Is there a way to listen on this event angular-kendo-like so I could act according to bound selected values?

mishoo commented 10 years ago

This happens with plain Kendo as well: http://dojo.telerik.com/ICiC — seems dataBound is fired before the widget's value() would return the correct data.

However, it works if you pass the value as an option, instead of setting it later: http://dojo.telerik.com/ICiC/2 (note, I had to comment autoBind: false or else the data doesn't load until you click it, so it appears initially empty). Here's this workaround applied to your sample (with Angular): http://dojo.telerik.com/EyuN/2