The drop down list is not setting it's value when the value is zero (data-value="0") and I'm not sure why. The seems to treat the values as numeric instead of a string. Please see the example:
http://dojo.telerik.com/UroFA
3 Answers, 1 is accepted
0
Georgi Krustev
Telerik team
answered on 16 Mar 2015, 04:16 PM
Hello Randy S,
Indeed, the parseOption functionality recognizes the "0" as a number and then sets it to the widget. The MultiSelect widget on the other hand cannot select 0 (as a number) as it expects string as a value option.
I would suggest you use the value binding in order to set the value you want.
Let me know if I can be of a further assistance.
Regards,
Georgi Krustev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
We are binding data on the server (rendering declarative html) so using mvvm isn't really an option for us in this case.
The DropDownList will bind with data-value and value IF you use an INPUT tag. We were using a SELECT tag to back the control. Why wouldn't it work the same for a SELECT and an INPUT. In the case of a DropDownList a SELECT element seems more appropriate anyway. Another Dojo showing this:
http://dojo.telerik.com/UroFA/3
I guess we will need to change our dropdown rendering to use an INPUT.
0
Georgi Krustev
Telerik team
answered on 18 Mar 2015, 04:17 PM
Hello CDC,
The value attribute works for INPUT element, because it has value attribute (INPUT help). The SELECT element, however, does not have value attribute, hence it is just ignored by HTML.
In this case, the best solution will be to use INPUT elements as it has value attribute.
Regards,
Georgi Krustev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!