Changing Kendo UI dropdownlist selection in code (v.3.80)

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
6 years ago
I'm trying to set the control type Kendo Ui dropdownlist "Control Type" in Products/Product Attributes  in code.

http://imgur.com/mfpBaAl
I seem to manage to change the selection using following code:

  

var a = $('[data-bind="value:AttributeControlTypeId"]')
                        .data("kendoDropDownList");
  $.each(a.dataSource.options.data, function (ix, item) {
                        
                        if (item.Id == 50)
                        {
                            $('[data-container-for="AttributeControlTypeId"]').children().hide();
                            a.select(ix);
                            a.value($("#" + item.Name).val());
                            return false;
                        }
                        });


Yet when i press the update button to save the current line, it shows the previously selected value.
Somehow i guess the model doesn't get updated.

Any help would be greatly appreciated :)
6 years ago
Hello Yannis,

Kendo grid will not change model value like this.

When you change something in grid then you can find updated value from datasource it self. And before that check dirty field. It will indicate has change or not.

Thanks,
Jatin
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.