MVVM not working with DropDownList when typeof data value is boolean

2 posts, 0 answers
  1. Wenhao
    Wenhao avatar
    17 posts
    Member since:
    Jan 2012

    Posted 03 Apr 2013 Link to this post

    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
  2. Holger
    Holger avatar
    77 posts
    Member since:
    Nov 2012

    Posted 03 Apr 2013 Link to this post

    Hi,

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

    Regards,
    Holger
  3. Kendo UI is VS 2017 Ready
Back to Top