Datasource for multiple input field

2 posts, 0 answers
  1. Markus
    Markus avatar
    71 posts
    Member since:
    Jan 2015

    Posted 27 Feb 2015 Link to this post

    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}]
  2. Markus
    Markus avatar
    71 posts
    Member since:
    Jan 2015

    Posted 27 Feb 2015 in reply to Markus Link to this post

    Solved thanks
Back to Top