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

Datasource for multiple input field

1 Answer 227 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Markus
Top achievements
Rank 1
Markus asked on 27 Feb 2015, 08:58 AM
Hi

In following example - http://dojo.telerik.com/IqIYI/5 - I am trying to understand how the data should be saved in my DB (and hence fed to the scheduler).

This is my custom edit template.

    <script id="editor" type="text/x-kendo-template">    <h3>Edit meeting</h3>    <p>
           <label>Title: <input name="title" /></label>    </p>    <p>
           <label>Start: <input data-role="datetimepicker" name="start" /></label>    </p>    <p>
           <label>End: <input data-role="datetimepicker" name="end" /></label>    </p>    <div class="k-edit-label">
            <label for="Contact">Contact</label>
        </div>
        <div data-container-for="Contact" class="k-edit-field">
            <select id="Contact" multiple="multiple" name="Contact"
                data-role="multiselect"
                data-bind="value:Contact"
                data-source='[
                    { "text": "Person1", "value": 1 },
                    { "text": "Person2", "value": 2 },
                    { "text": "Person3", "value": 3 }
                ]'
                data-text-field="text"
                data-value-field="value"
                data-value-primitive="true"
                ></select>
        </div> </script>


And my datasource for the only event (seen on the right in the example) is following:

    dataSource: [
        {
          id: 1,
          start: new Date("2013/6/6 08:00 AM"),
          end: new Date("2013/6/6 09:00 AM"),
          title: "Interview",
          contact: "[1, 2]"
        }
      ]

..The start, end date and the title fill the popup properly (when double clicking the "Interview" event on the right to show its contents).
However the Contact field does not fill.
I tried the following to no avail, does anyone have a clue?

    contact: [1,2]
    contact: {1,2}
    contact: [{1,2}]
    contact: [{value:1, value:2}]

1 Answer, 1 is accepted

Sort by
0
Markus
Top achievements
Rank 1
answered on 27 Feb 2015, 10:17 AM
Solved thanks
Tags
Scheduler
Asked by
Markus
Top achievements
Rank 1
Answers by
Markus
Top achievements
Rank 1
Share this question
or