How to best use multiselect for grid editing

3 posts, 1 answers
  1. Dan
    Dan avatar
    9 posts
    Member since:
    May 2013

    Posted 10 Jul 2014 Link to this post


    We have a grid bound to a remote datasource using MVVM, and have written a custom popup editor for editing items in the grid/datasource and it's all working well.

    We are in the process of extending our application to support multiselect fields. For example, let's say our datasource is employees, and the field in question is certifications. A single employee can have any number of certifications chosen from a predefined list. So, when we click edit for an employee in the grid, we'd like the popup to contain a multiselect where the user can add/remove certifications.

    Our first approach was to change the server side code to return an array for the certifications field. We have since learned that the datasource object does not support arrays in fields, and that it seems to automatically convert them to a comma-delimited list. We then considered just using a delimited string instead of an array, but then are unsure how to bind this field to the multiselect widget.

    We are open to whatever solution is best, but are not sure what that would be so were wondering if you'd have any advice on how to do this.

    Thanks for the help,
  2. Answer
    Georgi Krustev
    Georgi Krustev avatar
    3747 posts

    Posted 11 Jul 2014 Link to this post

    Hello Dan,

    I would suggest you check this code library (or this one), which shows how to use a MultiSelect widget as an editor in grid widget. Please check it and let me if I can be of any further assistance.

    Georgi Krustev
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. Dan
    Dan avatar
    9 posts
    Member since:
    May 2013

    Posted 11 Jul 2014 in reply to Georgi Krustev Link to this post

    Thank you Georgi. This was helpful. By looking at the example we figured out we should set our field type to "object" in our datasource's model (we're not using the MVC wrappers, just js). Before it was "string", which explains why the field was being converted to a string.

    Now things seem to be working better.

    As an aside, support for data type "object" does not seem to be documented here:

    Thanks for the help!
Back to Top