angularjs selected values issue

4 posts, 0 answers
  1. Enrico
    Enrico avatar
    54 posts
    Member since:
    Jun 2013

    Posted 16 Mar 2015 Link to this post

    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
  2. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3707 posts

    Posted 18 Mar 2015 Link to this post

    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!
     
  3. Kendo UI is VS 2017 Ready
  4. Enrico
    Enrico avatar
    54 posts
    Member since:
    Jun 2013

    Posted 18 Mar 2015 in reply to Georgi Krustev Link to this post

    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
  5. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3707 posts

    Posted 20 Mar 2015 Link to this post

    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!
     
Back to Top
Kendo UI is VS 2017 Ready