I am getting a stack overflow after setting the data source url on an igGrid object. The issue is a continuation of this one:
http://ko.infragistics.com/community/forums/t/74947.aspx
After I decided to go with Data Source Url because DataSource and DataSourceObject weren't working everything seemed to be okay for Safari, FireFox and IE9. When I went to test in IE8, it throws a stack overflow error on line 519. Which doesn't make any sense.
Once I debugged the script, it seems to be stuck at this block of code on jQuery.js v1.7.1:
if ( !eventHandle ) { elemData.handle = eventHandle = function( e ) { // Discard the second event of a jQuery.event.trigger() and // when an event is called after a page has unloaded return typeof jQuery !== "undefined" && (!e || jQuery.event.triggered !== e.type) ? jQuery.event.dispatch.apply( eventHandle.elem, arguments ) : undefined; }; // Add elem as a property of the handle fn to prevent a memory leak with IE non-native events eventHandle.elem = elem;}
This gets repeated indefinately until the stack overflow error has been reached.
My javascript code looks like this:
function getApprovals(id){ var url = '@(Url.Action("GetApprovals"))?cid=' + @(Model.Location.LocationId) + '&id=' + id;
$('#centerApprovalsGrid').igGrid('dataSourceObject', url); $('#centerApprovalsGrid').igGrid('dataBind');}
The Infragistics grid looks like this:@(Html.Infragistics().Grid() .ID("profitCenterApprovalsGrid") .AutoGenerateColumns(false) .RowTemplate("${LocationId}${LocationNumber}{{if ${IsCenter} === true && ${IsChild} === true}}${LocationNumber}${LocationName}{{elseif ${IsCenter} === true && ${IsChild} === false}}${LocationNumber} - ${LocationName}{{elseif ${IsCenter} === false && ${IsChild} === true && ${IsExpanded} === true}}${LocationNumber} ${LocationName}{{elseif ${IsCenter} === false && ${IsChild} === true && ${IsExpanded} === false}}${LocationNumber} ${LocationName}{{elseif ${IsCenter} === false && ${IsChild} === false && ${IsExpanded} === false}} ${LocationNumber} - ${LocationName}{{elseif ${IsCenter} === false && ${IsChild} === false && ${IsExpanded} === true}} ${LocationNumber} - ${LocationName}{{else}}${LocationNumber} - ${LocationName}{{/if}}${IsExpanded}${IsChild}${IsCenter}$${DeferralAmount}$${Sharing}$${AdditionalSharing}$${LcfWaiverAmount}$${ExceptionAmount}$${TotalSharing}${ManagerShare}%${ReviewDate}${SubmissionDate}${ApprovalDate}") .Columns(column => { column.For(m => m.LocationId).DataType("int"); column.For(m => m.LocationNumber).DataType("string"); column.For(m => m.LocationName).DataType("string").Width("195"); column.For(m => m.IsExpanded).DataType("boolean"); column.For(m => m.IsChild).DataType("boolean"); column.For(m => m.IsCenter).DataType("boolean"); column.For(m => m.DeferralAmount).DataType("number").Width("85").Format("0"); column.For(m => m.Sharing).DataType("number").Format("0").Width("85"); column.For(m => m.AdditionalSharing).DataType("number").Width("85").Format("0"); column.For(m => m.LcfWaiverAmount).DataType("number").Width("85").Format("0"); column.For(m => m.ExceptionAmount).DataType("number").Width("85").Format("0"); column.For(m => m.TotalSharing).DataType("number").Width("85").Format("0"); column.For(m => m.ManagerShare).DataType("number").Width("85").Format("0"); column.For(m => m.ReviewDate).DataType("date").Width("95"); column.For(m => m.SubmissionDate).DataType("date").Width("95"); column.For(m => m.ApprovalDate).DataType("date").Width("95"); }) .Features(feature => { feature.Updating() .EnableAddRow(false) .EnableDeleteRow(false) .EditMode(GridEditMode.None); feature.Hiding() .ColumnSettings(setting => { setting.ColumnSetting().ColumnKey("LocationId").Hidden(true).AllowHiding(false); setting.ColumnSetting().ColumnKey("LocationNumber").Hidden(true).AllowHiding(false); setting.ColumnSetting().ColumnKey("LocationName").AllowHiding(false); setting.ColumnSetting().ColumnKey("IsExpanded").Hidden(true).AllowHiding(false); setting.ColumnSetting().ColumnKey("IsChild").Hidden(true).AllowHiding(false); setting.ColumnSetting().ColumnKey("IsCenter").AllowHiding(false).Hidden(true); setting.ColumnSetting().ColumnKey("DeferralAmount").AllowHiding(false); setting.ColumnSetting().ColumnKey("Sharing").AllowHiding(false); setting.ColumnSetting().ColumnKey("AdditionalSharing").AllowHiding(false); setting.ColumnSetting().ColumnKey("LcfWaiverAmount").AllowHiding(false); setting.ColumnSetting().ColumnKey("ExceptionAmount").AllowHiding(false); setting.ColumnSetting().ColumnKey("TotalSharing").AllowHiding(false); setting.ColumnSetting().ColumnKey("ManagerShare").AllowHiding(false); setting.ColumnSetting().ColumnKey("ReviewDate").AllowHiding(false); setting.ColumnSetting().ColumnKey("SubmissionDate").AllowHiding(false); setting.ColumnSetting().ColumnKey("ApprovalDate").AllowHiding(false); }); }) .DataSourceUrl(Url.Action("GetCenterApprovals") + "?id=" + Model.Location.LocationId) .DataBind() .Render())
I attached a better formatted code in a file for better readability.
thoughts?
From looking at the event types, it seems to have originated from the MouseLeave, MouseMove and MouseOut events. I thinking they are recursively calling each other.
Hello Daniel,
You might check if the Ignite UI references are correctly used. Referring the loader (infragistics.dv.js) in combination with the infragistics.core.js, infragistics.lob.js and infragistics.dv.js could be the reason for the behavior observed.
A stack overflow might be also caused by endless recursions in the code. Javascript functions might implement such type of recursions. The scenario might be also tested with a different data source in order to identify if there are self-referring objects.
Hope this helps. If you need further assistance feel free to update the thread.
This was fixed with an update of Infragistics controls.