Kendo combobox.value (x) is not working properly

I am trying to set the kendo combobox value dynamically, but when trying:

var lvl1 = $("#level1Id").data("kendoComboBox");                        
var lvl2 = $("#level2Id").data("kendoComboBox");

var l2value = lvl2.value(); // save value for later use
... // do something that includes changing lvl2.value 
lvl2.value(l2value.toString()); // set lvl2.value back to previous

the combobox value is set in the "Code" field - for example, 2, instead of the "Value / Text" field - "the corresponding value code for the l2 value". I understand that the value of (x) takes a string parameter, so I tried different conversion methods (int-> string), but no luck. Am I missing something? The value of this combobox value is dynamically important to me, so any help would be appreciated.

EDIT: I change the combobox filter just before setting the value a second time. Maybe the reason is here?

+1
source share
1 answer

: http://jsfiddle.net/pvanhouten/qb8rD/1/. , (), (1). , . apple, apple . -, , , , , . ?

+2

Source: https://habr.com/ru/post/1527885/


All Articles