MVVM now storing item as "[Object, object]" instead of the object

3 posts, 1 answers
  1. Steve
    Steve avatar
    1871 posts
    Member since:
    Dec 2008

    Posted 28 Aug Link to this post

    Kendo updated with our last Sitefinity update, and previous to now it always stored the selected item in the list to the MVVM model.  However in the current version it seems to just store literally as the string "[Object, object]"

    I've tried setting data-value-primitive to true\false, no change either way.

     

    <select class="schedules form-control"
                                     data-bind="source: schedule, value: location.schedule, events: { change: onScheduleChange }, visible: hasScheduleItems"
                                     data-text-field="StartDateFormatted"
                                     data-value-primitive="false"
                                     data-role="dropdownlist"
                                     data-option-label="Select a schedule entry"
                                     style="width: 100%; max-width: 300px">
                                </select>
  2. Answer
    Dimitar
    Admin
    Dimitar avatar
    216 posts

    Posted 30 Aug Link to this post

    Hello Steve,

    On the following Dojo example a similar scenario to the one described is demonstrated (Kendo UI DropDownList MVVM) . With it, the binding works as expected and the selected model value is properly assigned.

    In the currently provided example I have noticed that the data-value-field attribute is missing from the configuration options of the DropDownList, but is actually needed because it specifies the field of the current item to which the option value is bound. When the element options are created by the source binding, Kendo UI MVVM selects the option which corresponds to the View-Model value specified by the value binding. 

    After adding the above mentioned attribute, you will notice that the issue is successfully resolved. Additional information on the topic can be found in the following Value Binding article

    Regards,
    Dimitar
    Progress Telerik
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  3. Steve
    Steve avatar
    1871 posts
    Member since:
    Dec 2008

    Posted 31 Aug in reply to Dimitar Link to this post

    Back in business, thx!
Back to Top