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

angularjs selected values issue

3 Answers 293 Views
MultiSelect
This is a migrated thread and some comments may be shown as answers.
Enrico
Top achievements
Rank 1
Enrico asked on 16 Mar 2015, 08:29 AM
Hi,

in the past days I had a problem loading initial selected values into a kendo-multi-select.

The list is populated by a odata kendoDataSource and I've been setting k-options as
{
    autoBind: false,
    value: theArrayOfIdAndDisplayNameProperties
}

I've tried two different approaches:
1. load the selected values into the controller activation and use k-rebind
2. load the selected values into route resolve without using k-rebind

It turned out that the only way to get this work is the second, because if I'm loading data into the controller in an async way a digest exception is thrown every time. I've try to put the call in $timeout as explained into the guide: http://docs.telerik.com/kendo-ui/web/multiselect/how-to/AngularJS/pre-select-items but no chance.

Is there a way to load initial items from a controller without causing a digest error?

I'm using AngularJS 1.2.27 and Kendo UI v2014.3.1411

Thanks,
Enrico

3 Answers, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 18 Mar 2015, 07:31 AM
Hello Enrico,

Based on the given information, I believe that you would like to pre-select items without loading the widget. If this is the case, then I will suggest you check this how-to demo, which shows how to accomplish this task.

Regards,
Georgi Krustev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Enrico
Top achievements
Rank 1
answered on 18 Mar 2015, 10:36 AM
Hi,

as you see the link suggested is the same that I've mentioned in my initial post. If you try to run it in kendo ui dojo does not seem to work (please check Pre-select items using data loaded via ajax).

BR,
Enrico
0
Georgi Krustev
Telerik team
answered on 20 Mar 2015, 09:08 AM
Hello Enrico,

Please excuse me for missing the shared link. I modified the demo (http://dojo.telerik.com/@ggkrustev/AkaPE) using k-rebind and k-ng-delay as they are two possible approaches to pre-select items in MultiSelect using autoBind: false option. In both cases, I could not replicate the digest error. Would it be possible to modify the demo in order to reproduce the issue?

Regards,
Georgi Krustev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
MultiSelect
Asked by
Enrico
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Enrico
Top achievements
Rank 1
Share this question
or