I upgraded to 15.2. After the update it is no longer allowing me to hide columns. I am getting the following console error:
Uncaught TypeError: Cannot read property 'key' of undefined
I attached my code below:
@(Html.Infragistics() .Grid(Model) .ID("CAMExpenseListGrid") .AutoGenerateColumns(false) .PrimaryKey("Id") .RenderCheckboxes(true) .AutoCommit(true) .Columns(column => {
column.For(x => x.Id).HeaderText("Id").DataType("number"); column.For(x => x.ExternalId).HeaderText("ExternalId").DataType("text"); column.For(x => x.CAMName).HeaderText("Name").DataType("text"); column.For(x => x.YearlyCAMAmount).HeaderText("Amount/Yr").DataType("number"); column.For(x => x.MonthlyCAMAmount).HeaderText("Amount/Mo").DataType("number"); column.For(x => x.PerSqFtCAMAmount).HeaderText("Amount/SF").DataType("number"); column.For(x => x.StartingIncome).HeaderText("Starting Income").DataType("number"); column.For(x => x.IsCAMActive).HeaderText("Active?").DataType("bool"); column.For(x => x.CamStartDate).HeaderText("Start Date").DataType("date"); }) .Features(f => { f.Paging().Type(OpType.Local).PageSize(20).TotalRecordsCount(Model.Count());
f.Responsive();
f.Updating() .ColumnSettings(cs => { cs.ColumnSetting().ColumnKey("Id").EditorType(ColumnEditorType.Numeric).Required(true).ReadOnly(true); cs.ColumnSetting().ColumnKey("ExternalId").EditorType(ColumnEditorType.Numeric); cs.ColumnSetting().ColumnKey("CAMName").EditorType(ColumnEditorType.Text).Required(true); cs.ColumnSetting().ColumnKey("YearlyCAMAmount").EditorType(ColumnEditorType.Currency); cs.ColumnSetting().ColumnKey("MonthlyCAMAmount").EditorType(ColumnEditorType.Currency); cs.ColumnSetting().ColumnKey("PerSqFtCAMAmount").EditorType(ColumnEditorType.Currency); cs.ColumnSetting().ColumnKey("StartingIncome").EditorType(ColumnEditorType.Currency); cs.ColumnSetting().ColumnKey("IsCAMActive"); cs.ColumnSetting().ColumnKey("CamStartDate").EditorType(ColumnEditorType.DatePicker); }) .EnableAddRow(true) .EditMode(GridEditMode.Dialog) .EnableDeleteRow(true) .RowEditDialogOptions(opt => { opt.Containment("owner"); opt.DialogTemplateSelector("#dialogTemplate"); opt.EditorsTemplateSelector("#editorsTemplate"); opt.ShowReadonlyEditors(false); opt.Width("300px"); opt.Height("400px"); }); f.Hiding() .ColumnSettings(cs => { cs.ColumnSetting().ColumnKey("Id").Hidden(true).AllowHiding(false); cs.ColumnSetting().ColumnKey("ExternalId").AllowHiding(false); cs.ColumnSetting().ColumnKey("CAMName").AllowHiding(false); cs.ColumnSetting().ColumnKey("YearlyCAMAmount").AllowHiding(false); cs.ColumnSetting().ColumnKey("MonthlyCAMAmount").AllowHiding(false); cs.ColumnSetting().ColumnKey("PerSqFtCAMAmount").AllowHiding(false); cs.ColumnSetting().ColumnKey("StartingIncome").AllowHiding(false); cs.ColumnSetting().ColumnKey("IsCAMActive").AllowHiding(false); cs.ColumnSetting().ColumnKey("CamStartDate").AllowHiding(false);
});
})
.DataBind() .Render())
I removed hiding and added it in column settings of the whole grid when I declare the Keys and the model's columns:
@(Html.Infragistics().Grid(Model).ID("CAMExpenseListGrid").AutoGenerateColumns(false).PrimaryKey("Id").RenderCheckboxes(true).AutoCommit(true).Columns(column =>{
column.For(x => x.Id).HeaderText("Id").DataType("number").Hidden(true);column.For(x => x.ExternalId).HeaderText("ExternalId").DataType("text").Hidden(true); //THIS IS WHERE I ADDED THE HIDDEN ATTRIBUTEScolumn.For(x => x.CAMName).HeaderText("Name").DataType("text");column.For(x => x.YearlyCAMAmount).HeaderText("Amount/Yr").DataType("number");column.For(x => x.MonthlyCAMAmount).HeaderText("Amount/Mo").DataType("number");column.For(x => x.PerSqFtCAMAmount).HeaderText("Amount/SF").DataType("number");column.For(x => x.StartingIncome).HeaderText("Starting Income").DataType("number");column.For(x => x.IsCAMActive).HeaderText("Active?").DataType("bool");column.For(x => x.CamStartDate).HeaderText("Start Date").DataType("date");}).Features(f =>{f.Paging().Type(OpType.Local).PageSize(20).TotalRecordsCount(Model.Count());
f.Updating().ColumnSettings(cs =>{cs.ColumnSetting().ColumnKey("Id").EditorType(ColumnEditorType.Numeric).Required(true).ReadOnly(true);cs.ColumnSetting().ColumnKey("ExternalId").EditorType(ColumnEditorType.Numeric);cs.ColumnSetting().ColumnKey("CAMName").EditorType(ColumnEditorType.Text).Required(true);cs.ColumnSetting().ColumnKey("YearlyCAMAmount").EditorType(ColumnEditorType.Currency);cs.ColumnSetting().ColumnKey("MonthlyCAMAmount").EditorType(ColumnEditorType.Currency);cs.ColumnSetting().ColumnKey("PerSqFtCAMAmount").EditorType(ColumnEditorType.Currency);cs.ColumnSetting().ColumnKey("StartingIncome").EditorType(ColumnEditorType.Currency);cs.ColumnSetting().ColumnKey("IsCAMActive");cs.ColumnSetting().ColumnKey("CamStartDate").EditorType(ColumnEditorType.DatePicker);}).EnableAddRow(true).EditMode(GridEditMode.Dialog).EnableDeleteRow(true).RowEditDialogOptions(opt =>{opt.Containment("owner");opt.DialogTemplateSelector("#dialogTemplate");opt.EditorsTemplateSelector("#editorsTemplate");opt.ShowReadonlyEditors(false);opt.Width("300px");opt.Height("400px");});
.DataBind().Render())
Hello Landrum,
I can replicate the issue. I logged an internal issue with Development ID 213548 so that we can investigate it further.
I also created a case on your behalf with number CAS-169305-T1X7G8, so that you can be notified when there is a resolution for the issue.
You can find your active cases under Account - Support Activity in our website. Select your ticket and go to Development Issues tab to view the status of related development issues.
As a workaround I can suggest you to disable the Responsive feature.
Best regards,Martin PavlovInfragistics, Inc.
The fix for development issue 213548 is available in the latest service release which can be downloaded from the My Keys and Downloads page.