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

[Bug] MultiSelect EditorTemplate only fires grid "save" event once

9 Answers 174 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Curt Rabon
Top achievements
Rank 1
Veteran
Curt Rabon asked on 18 Mar 2015, 01:57 AM
Kendo MVC 2014.3.1516

Bug:
If you use a MultiSelectFor in an EditorTemplate, the grid's "save" event will only fire once for that cell.  The second time you update the same cell (by picking an additional item or removing an item from the MultiSelect list), the grid's save event is not called.

9 Answers, 1 is accepted

Sort by
0
Curt Rabon
Top achievements
Rank 1
Veteran
answered on 18 Mar 2015, 02:07 AM
columns.Bound(c => c.HTMLAttributes)
  .Title("HTML Attr").Sortable(false).Filterable(false)
  .EditorTemplateName("HtmlAttributes");

EditorTemplate (AppCache.HtmlAttributes is a server array of a custom object)
@model object
 
@(Html.Kendo().MultiSelectFor(m => m)
    .Name("HtmlAttrList")
    .Animation(false)
    .DataValueField("ID")
    .DataTextField("Text")
    .BindTo(AppCache.HtmlAttributes)
 )
0
Curt Rabon
Top achievements
Rank 1
Veteran
answered on 18 Mar 2015, 02:02 PM
@(Html.Kendo().Grid<Field>()
                    .Name("fieldGrid")
                    .Columns(columns => ....)
                     
                    .Scrollable(scrollable => scrollable.Virtual(true))
                    .Sortable()
                    .Filterable()
                    .Editable(e => e.Mode(GridEditMode.InCell))       
                    .AutoBind(false)
                     
                    .Events(e => e
                        .Edit("myEdit")
                        .Save("mySave")
                    )
                    
                    .DataSource(ds => ds
                        .Ajax()
                        .ServerOperation(false)
                        .Model(model =>
                        {
                            model.Id(c => c.Name);
                            model.Field(c => c.Name).Editable(false);
                        })
                    )
                )
0
Petur Subev
Telerik team
answered on 20 Mar 2015, 07:22 AM
Hello Curt,

The Grid widget does not support and it is not intended to edit nested arrays out-of-the-box. You can use the work-around from this code library project to enable such support:

http://www.telerik.com/support/code-library/using-multiselect-in-grid

Kind Regards,
Petur Subev
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Curt Rabon
Top achievements
Rank 1
Veteran
answered on 20 Mar 2015, 03:33 PM
I don't understand what using a MultiSelect as a column editor has to do with "nested arrays".  Does the grid support using the Kendo MultiSelect as a column editor?  If so, then shouldn't the grid "save" event always be called when updating the column value by using the MultiSelect?
0
Curt Rabon
Top achievements
Rank 1
Veteran
answered on 20 Mar 2015, 03:40 PM
OK, I now understand what you are saying.  The MultiSelect produces an array and that's not supported as a column editor when editing inline or inCell.

Is there a document that tells me what Kendo widgets are or are not supported in the grid?  Please don't leave it up to your customers to guess.
0
Accepted
Petur Subev
Telerik team
answered on 23 Mar 2015, 04:01 PM
Hello Curt,

MultiSelect is the only widget which value is actually an array. DatePicker, DropDownLists , ComboBoxes, inputs, color pickers are all single values. For the specific case with the MultiSelect we have created the code library article.

http://www.telerik.com/support/code-library/using-multiselect-in-grid

Kind Regards,
Petur Subev
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Curt Rabon
Top achievements
Rank 1
Veteran
answered on 24 Mar 2015, 07:48 PM
Thank you.
0
Neil
Top achievements
Rank 1
answered on 12 Jul 2017, 07:56 PM
How do you get the Editor to come up with the selected items already highlighted?
0
Georgi
Telerik team
answered on 14 Jul 2017, 01:45 PM
Hello Neil,

If the multi select inputs in the edit template are named as the properties in the model, the multi select will bound automatically to the values in the properties.

Please refer to the attached sample (custom-editor.zip) which illustrates how multi selects bind to the property with the same name.


Regards,
Georgi
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.
Tags
Grid
Asked by
Curt Rabon
Top achievements
Rank 1
Veteran
Answers by
Curt Rabon
Top achievements
Rank 1
Veteran
Petur Subev
Telerik team
Neil
Top achievements
Rank 1
Georgi
Telerik team
Share this question
or