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

MVVM not working with DropDownList when typeof data value is boolean

1 Answer 243 Views
DropDownList
This is a migrated thread and some comments may be shown as answers.
Wenhao
Top achievements
Rank 1
Wenhao asked on 03 Apr 2013, 08:19 AM
Hello Kendo,

I just used the following test code with kendo DropDownList mvvm as to your demo:

    <script>
    $(function() {
          var vm = kendo.observable({
            dropdownlistSource: [
              { text: 'True', value: true },
              { text: 'False', value: false }
            ],
            selected: null
          });

          vm.selected = vm.dropdownlistSource[1];
      kendo.bind($('body'), vm);
    });
    </script>
</head>
<body>
      <input data-role="dropdownlist" data-text-field="text" data-value-field="value" data-bind="source: dropdownlistSource, value: selected" />
</body>

However, the widget just display the first item every time, not the value demonstrated in data-bind attr. When i switch the value field of data source to interger 1 and 0, that works perfect.

I think this would be a bug in your control, and please pay attention to it when u r free.

Wenhao

1 Answer, 1 is accepted

Sort by
0
Holger
Top achievements
Rank 1
answered on 03 Apr 2013, 01:38 PM
Hi,

I experienced a similar problem.
For a possible solution please refer to the following thread: DropDownList as custom editor in grid

Regards,
Holger
Tags
DropDownList
Asked by
Wenhao
Top achievements
Rank 1
Answers by
Holger
Top achievements
Rank 1
Share this question
or