I am upgrading to Ignite UI 2015.1. In my previous version, 2014.2, I had configured an igGrid to include a combo box that allowed for multiSelection. The grid was setup via the MVC helpers. Where is the multiselection setting for the combo in the MVC helper for 2015.1? I cannot seem to find it. Would someone please provide an example?
Here is the error message I am receiving after upgrading to 2015.1 without changes.
System Error: c:\Projects\Summit\Source\WebApplication\Main\Summit.UI.Web\Views\Preferred\Knockout.cshtml(184): error CS1061: 'Infragistics.Web.Mvc.ComboWrapper' does not contain a definition for 'MultiSelection' and no extension method 'MultiSelection' accepting a first argument of type 'Infragistics.Web.Mvc.ComboWrapper' could be found (are you missing a using directive or an assembly reference?)
For those curious, this issue was a bug in 2015.1. There is a service release that contains a fix.
http://es.infragistics.com/community/blogs/engineering/archive/2015/06/16/ignite-ui-release-notes-june-2015-14-2-15-1-service-release.aspx
Hello Dan,
Thank you for posting in our community.
Since igCombo which is the base for the igGrids combo editor provider has undergone some changes in version 15.1 the same applies for the combo editor as well. There is a detailed topic describing migration to the new combo at the following link:
http://www.igniteui.com/help/igcombo-migrating-to-the-new-combo
Basically, multiple selection could be enabled from the editorOptions in the Updating columns settings. For example:
features: [ { name: "Updating", editMode: "row", columnSettings: [ { columnKey: "Product", editorType: "combo", editorOptions: { dataSource: productList, textKey: "Number", valueKey: "Number", multiSelection: { enabled: true, showCheckboxes: true } } } ] } ]
Please keep in mind that this scenario is not supported out of the box since the grid does not allow saving of complex values in the data source. To support such scenarios a custom implementation will need to be applied for the getValue/setValue methods of the igCombo provider to handle the scenarios when complex data(in form of an array) is passed from the combo`s multiple selection to the grid. This could be achieve on the render event of igGrid. For example:
rendered: function (evt, ui) { ///overriding the combo editor for "ttl_language" and adding a logic for handling var $editor = $("#grid1").igGridUpdating("editorForCell", $("#grid1").igGrid("cellById", $("#grid1").igGrid("rows")[0].getAttribute("data-id"), "Product"), true); $editor.data("igEditorFilter").options.provider.getValue = function () { return this.editor.valueInput().val(); } $editor.data("igEditorFilter").options.provider.setValue = function (val, fire) { return this.editor.value(val.split(this.editor.options.multiSelection.itemSeparator)); } }
I am also attaching a small sample that demonstrates my suggestion.
Please have a look at this small application and let me know if you have any additional questions afterwards.
Hi Vasya. Thank you so much for responding to my question and clarifying. I just downloaded the jQuery 15.2 library. I noticed that the MultiSelection (via MultiSelectionSettings) is available. I am able to configure my grid using the MVC helper to use multiselection with checkboxes for a combo column. However, I also read in the documentation that the AllowCustomValue options is added back in. However, I have not been able to find this property in the MVC Helper. Would you mind providing the syntax for an igGrid that allows multiselection in a column and allows for custom values?
How did you set up the MultiSelectionSettings with the MVC Helper? i'm trying to do that now, with 15.2 and i can't seem to figure it out..
wvusaf,
I upgraded to v15.2 but I believe this issue was in v15.1 and 15.2. There is a service release for v15.2 that fixes this issue. According to Infragistics support, this has been addressed in service release versions _15.2.20152.2081. However, if you are going to use the "EditorOptions" method for the ColumnSettings. An example is below:
cs.ColumnSetting().ColumnKey("Attributes").EditorType(ColumnEditorType.Combo).Required(true).EditorOptions("dataSource: " + Json.Encode(Model.Attributes) + ", dataSourceType: 'json', valueKey: 'Value', textKey: 'Text', Mode: 'dropdown', allowCustomValue: true, multiSelection: { enabled: true, itemSeparator: '/', showCheckboxes: true}, filteringType: 'none'");
This trick is that you have to put all of the options into the EditorOptions. You cannot use part of the MVC helper options and part of the text EditorOptions. The MVC options will override all the MVC EditorOptions.
I hope this helps.