Hello everybody!
I have a model with a boolean parameter.
In a igGrid, the boolean value is displayed in a checkbox as well as in a igDialog.
In fact, when editing a row, I use the mode RowEditTemplate. The problem is that I can't get the value of the boolean value when editing the row (I need it for disabling or not a combo in the same igDialog).
Here a part of the (simplified) code:
<script id="RowEditDialogRowTemplate1" type="text/x-jquery-tmpl">
<tr><td>${headerText}</td><td data-key='${dataKey}'>{{if ${headerText} =='boolvalue'}}<input class="check" id="${dataKey}_inputcheck" type='checkbox' checked ="checked"/>{{else}}<input id="${dataKey}_input"/> {{/if}} </td></tr>
</script>
<h2>Produits</h2>
@(Html.Infragistics().Grid<Model>()
.ID("grid1") .PrimaryKey("Id") .RenderCheckboxes(true).Columns(column => {
column.For(x => x.Id).Hidden(true);
column.For(x => x.Name);
column.For(x => x.boolvalue);
column.For(x => x.Status);})
.Features(features =>{
features.Updating().EditMode(GridEditMode.RowEditTemplate).RowEditDialogRowTemplateID("RowEditDialogRowTemplate1").Validation(true).EnableAddRow(true).ColumnSettings(settings =>{
settings.ColumnSetting().ColumnKey("Status").EditorType(ColumnEditorType.Combo) .ComboEditorOptions(options => {options.DataSource(statusSource); });});})
.EnableHoverStyles(true) .Height("500px").Width("100%").DataSourceUrl("/api/products/").LocalSchemaTransform(true).DataBind().Render())
Then, when opening the rowTemplate:
$(#grid1").live("iggridupdatingroweditdialogopening", function (e, ui) { /*How I can get the value of the checkbox for disable or not the combo Status???*/ }
Please, if anyone have an idea or a solution, let me know.
Regards,
F2O
Hi,
I'm just checking if you have managed to resolve your issue.
Hello F2O,
I would suggest you to get the checkbox value in rowEditDialogOpened event like this:
$("#grid1").on("iggridupdatingroweditdialogopened", function (e, ui) { var checked = ui.dialogElement.find("input:checkbox")[0].checked; });
Please let me know if this helps.