Hi. I am testing IgniteUI 2012.2's igGrid in RowEditTemplate update mode within MVC/Razor. I noticed that when I am in "row" mode, the igCombo displays the value from the cell properly. However, when utilizing the RowEditTemplate mode, the value in the igCombo is blank. Is there anything special that need to be done to display the value that should be passed from the grid row to the R.E.T? I am just pulling a country list from a ViewData to populate the combobox. Nothing fancy is going on within the project.
Here are my js script calls:
<script src="~/Scripts/modernizr-1.7.min.js" type="text/javascript"></script> <script src="~/scripts/jquery.min.js" type="text/javascript"></script> <script src="~/scripts/jquery-ui.min.js" type="text/javascript"></script> <script src="~/scripts/jquery.tmpl.min.js" type="text/javascript"></script> <script src="~/Scripts/js/infragistics.loader.js"></script>
Here is my loader:
@(Html.Infragistics().Loader() .ScriptPath(Url.Content("~/Scripts/js/")) .CssPath(Url.Content("~/Content/css/")) .Resources("igEditors,igCombo,igValidator,igGrid.Updating") //.Theme("Metro") .Render() )
My Update call for the column is:
settings.ColumnSetting().ColumnKey("Region").EditorType(ColumnEditorType.Combo).ComboEditorOptions(options => { options.ValidatorOptions(option => { option.KeepFocus(ValidatorKeepFocus.Never); option.BodyAsParent(false); option.Required(true); }); options .DataSource(ViewData["RegionDS"]) .TextKey("name") .ValueKey("id") .AllowCustomValue(false) .Mode(ComboMode.DropDown); });
The template pulls up fine if I display as a text field. Can you provide an explanation based on my snippets and/or provide a sample?
Thanks
Hello sirplaya,
While we release the service release containing the resolution for this issue you can set the text manually. In order to do so you can handle the rowEditDialogOpened event and get the dom element for the combo. Then using the igCombo api you can set the text property to the current value:
rowEditDialogOpened: function (event, ui) {
var comboInput = $("td[data-key='Color']").find('input');
comboInput.igCombo('text', comboInput.data('igCombo').options.value);
},
Hello sirplaya ,
Thank you for the details. After some investigation I believe that this behavior could be caused by an issue in the rowEditTemplate functionality therefore I log it in our issue tracking system with the id of 130199. In order to track the progress of the issue I have created a private support ticket for you with the id of CAS-107608-P8N9V5. This way you will be notified as soon as our developers suggest a resolution for this behavior.
I will provide you with more details through the support ticket.