Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
455
Update of jquery giving iggrid initialization problems
posted

I am battling with an awkward problem at the moment. I am using the IgniteUI 2012.2 version ( live not trial ).

I am in the process of updating jquery 

everything works with jquery-1.7.2.min.js and ui-1.8.11.min.js but fails with

jquery-1.8.3.min.js and jquery-ui-1.9.0.min.js.

My scenario is that I have a partial view in MVC4 which loads the div with a string initially but later populates it from a custom model. All my events are set up in the .ready of the highest level document which also has the ig.loader.

The partial view is as follows

@using Infragistics.Web.Mvc
@using Mintec.Common.Data
@using System.Data
@using System.Diagnostics


@model IQueryable<DataSeriesItemViewModel>


<div id="GetSeriesDialogGrid" class='grid-tab0'></div>
@{
if( Model != null && Model.Any() ){
Infragistics.Web.Mvc.IGrid<IQueryable<DataSeriesItemViewModel>> item1 = Html.Infragistics().Grid<IQueryable<DataSeriesItemViewModel>>().DataSource(Model);
Infragistics.Web.Mvc.IGrid<IQueryable<DataSeriesItemViewModel>> item2 = item1.ID("GetSeriesDialogGrid").DefaultColumnWidth("120px").PrimaryKey("SeriesCode").Virtualization(true).VirtualizationMode(VirtualizationMode.Fixed).Height("400px").AutoGenerateColumns(true);
Infragistics.Web.Mvc.IGrid<IQueryable<DataSeriesItemViewModel>> item3 = item2.Features(
features =>
{
features.Selection().MultipleSelection(true).Mode(SelectionMode.Row);
features.Hiding().ColumnSettings(
settings =>
{
settings.ColumnSetting().ColumnKey("IsSelected").AllowHiding(false).Hidden(false);
settings.ColumnSetting().ColumnKey("SeriesCode").AllowHiding(false).Hidden(true);
settings.ColumnSetting().ColumnKey("SeriesSpecification").AllowHiding(false).Hidden(true);
settings.ColumnSetting().ColumnKey("MarketCode").AllowHiding(false).Hidden(true);
settings.ColumnSetting().ColumnKey("StartDate").AllowHiding(false).Hidden(true);
settings.ColumnSetting().ColumnKey("UnitMultiplier").AllowHiding(false).Hidden(true);
settings.ColumnSetting().ColumnKey("CountryName").AllowHiding(false).Hidden(true);
settings.ColumnSetting().ColumnKey("IsExportable").AllowHiding(false).Hidden(true);
settings.ColumnSetting().ColumnKey("CurrencyName").AllowHiding(false).Hidden(false);
settings.ColumnSetting().ColumnKey("DataTypeName").AllowHiding(false).Hidden(false);
settings.ColumnSetting().ColumnKey("SeriesName").AllowHiding(false).Hidden(false);
settings.ColumnSetting().ColumnKey("SeriesDescription").AllowHiding(false).Hidden(false);
settings.ColumnSetting().ColumnKey("DataFreqName").AllowHiding(false).Hidden(false);
settings.ColumnSetting().ColumnKey("UnitName").AllowHiding(false).Hidden(false);
}
);
/*features.Paging().PageSize(8).VisiblePageCount(3).ShowPageSizeDropDown(false);*/
features.Filtering().Mode(FilterMode.Advanced)
.ColumnSettings(
settings =>
{
settings.ColumnSetting().ColumnKey("SeriesCode").AllowFiltering(false);
settings.ColumnSetting().ColumnKey("SystemLanguageCode").AllowFiltering(false);
settings.ColumnSetting().ColumnKey("IsSelected").AllowFiltering(false);
settings.ColumnSetting().ColumnKey("SeriesName").AllowFiltering(false);
settings.ColumnSetting().ColumnKey("SeriesDescription").AllowFiltering(false);
settings.ColumnSetting().ColumnKey("SeriesSpecification").AllowFiltering(false);
settings.ColumnSetting().ColumnKey("DataTypeName").AllowFiltering(true);
settings.ColumnSetting().ColumnKey("DataFreqName").AllowFiltering(true);
settings.ColumnSetting().ColumnKey("MarketCode").AllowFiltering(true);
settings.ColumnSetting().ColumnKey("StartDate").AllowFiltering(false);
settings.ColumnSetting().ColumnKey("UnitName").AllowFiltering(true);
settings.ColumnSetting().ColumnKey("CurrencyName").AllowFiltering(true);
settings.ColumnSetting().ColumnKey("CountryName").AllowFiltering(false);
settings.ColumnSetting().ColumnKey("IsExportable").AllowFiltering(false);
}
);
features.Updating().EnableAddRow(false).EditMode(GridEditMode.Row).EnableDeleteRow(false).ShowDoneCancelButtons(false).ColumnSettings(settings =>
{
settings.ColumnSetting().ColumnKey("SeriesDescription").ReadOnly(true);
settings.ColumnSetting().ColumnKey("SeriesName").ReadOnly(true);
settings.ColumnSetting().ColumnKey("DataTypeName").ReadOnly(true);
settings.ColumnSetting().ColumnKey("CurrencyName").ReadOnly(true);
settings.ColumnSetting().ColumnKey("UnitName").ReadOnly(true);
settings.ColumnSetting().ColumnKey("DataFreqName").ReadOnly(true);
settings.ColumnSetting().ColumnKey("IsSelected").ReadOnly(true);
});
}
);

Infragistics.Web.Mvc.IGrid<IQueryable<DataSeriesItemViewModel>> item4 = item3.DataBind();
for (int i = 0; i < item4.Model.Columns.Count; i++)
{
switch (item4.Model.Columns[i].Key)
{
case "SeriesDescription":
item4.Model.Columns[i].HeaderText = "Description";
break;
case "SeriesName":
item4.Model.Columns[i].HeaderText = "Series ID";
item4.Model.Columns[i].Width = "75px";
break;
case "DataTypeName":
item4.Model.Columns[i].HeaderText = "Series Type";
break;
case "CurrencyName":
item4.Model.Columns[i].HeaderText = "Currency";
break;
case "UnitName":
item4.Model.Columns[i].HeaderText = "Unit";
break;
case "DataFreqName":
item4.Model.Columns[i].HeaderText = "Frequency";
break;
case "IsSelected":
item4.Model.Columns[i].HeaderText = " ";
item4.Model.Columns[i].Width = "30px";
item4.Model.Columns[i].Template = "{{if ${IsSelected}==true}}<input type='checkbox' name='gridCheckbox' checked>{{else}}<input type='checkbox' name='gridCheckbox'>{{/if}}";
break;
}
}

MvcHtmlString item6 = item4.Render();
@item6;
}
else{
<br /><br />
<div id='emptyGetSeriesDialogGrid' align='center'>-- Select a Market Segment --</div>
}
}

With the lower version of jquery it all works fine and I can call any of the delegate methods.

The later version gives the following error

JavaScript runtime error: cannot call methods on igGridSelection prior to initialization; attempted to call method 'selectedRows'

Any ideas?

  • 7499
    posted

    Hello Bubblesdad,

    Thank you for posting to Infragsitics forums.

    Are you using lastest service release of 2012.2? Can you provide me with the build number you are using? you can find this information in one of the infragistics js files, looks like 12.2.20122.2290.

    Please let me know if you have any further questions regarding this matter.