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

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

2 Answers 88 Views
DropDownList
This is a migrated thread and some comments may be shown as answers.
Matt
Top achievements
Rank 1
Matt asked on 29 Jan 2019, 07:44 PM

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 Answers, 1 is accepted

Sort by
0
Accepted
Bozhidar
Telerik team
answered on 31 Jan 2019, 02:20 PM
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.
0
Matt
Top achievements
Rank 1
answered on 01 Feb 2019, 01:09 PM
That did it. I also had k-value-primitive="'false'" (double-quote single-quote) instead of k-value-primitive="false" (double-quote only)
Tags
DropDownList
Asked by
Matt
Top achievements
Rank 1
Answers by
Bozhidar
Telerik team
Matt
Top achievements
Rank 1
Share this question
or