ngRepeat using non-value-primitive does not initialize selected value

3 posts, 1 answers
  1. Matt
    Matt avatar
    9 posts
    Member since:
    Feb 2008

    Posted 29 Jan Link to this post

    In the example below there is an array of values displayed using an ng-repeat directive. They are all bound to drop down lists with a common data source. The valuePrimitive setting is false so a proper POJO is set to and bound to k-ng-model. However, when the drop downs are rendered the selected value is not displayed. The selected value is present as evidenced by the Selection output.

    How can the value be displayed when it is not a primitive and it is pre-loaded (e.g. not selected by the user)?

    https://dojo.telerik.com/EjEDoQAG

  2. Answer
    Bozhidar
    Admin
    Bozhidar avatar
    1189 posts

    Posted 31 Jan Link to this post

    Hi,

    The dataValueField was not declared, so after adding it to the dropdownlist declaration the sample works correctly:
    https://dojo.telerik.com/EjEDoQAG/7

    Regards,
    Bozhidar
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
  3. Matt
    Matt avatar
    9 posts
    Member since:
    Feb 2008

    Posted 01 Feb in reply to Bozhidar Link to this post

    That did it. I also had k-value-primitive="'false'" (double-quote single-quote) instead of k-value-primitive="false" (double-quote only)
Back to Top