Modal dialog not closing properly if initialized in different container then the grid itself with "Cannot read property 'focus' of undefined"
New DiscussionAn exception is being thrown while selecting different rows :
The code from 16-1.lob :
_selectionToggle: function (element, dontToggle) {
var sel = this.grid.element.data(“igGridSelection”);
if (!sel) {
return;
}
sel._suspend = !sel._suspend;
if (element || dontToggle) {
this._actElement = element;
} else {
this._actElement.focus();
}
},
The bug, IMHO, is that the state of the grid while entering the method is not good enough to process. Here are the states of the different variables :
this._actElement === undefined
-> true
dontToggle
-> undefined
element
-> null
The error message and stack trace are :
Uncaught TypeError: Cannot read property ‘focus’ of undefined(…)
(anonymous function) @ VM1908:1
InjectedScript._evaluateOn @ (program):145
InjectedScript._evaluateAndWrap @ (program):137
InjectedScript.evaluateOnCallFrame @ (program):151
$.widget._selectionToggle @ infragistics.lob-16.1.js:69400
(anonymous function) @ jquery-ui-1.10.3.js:401
$.widget._endEdit @ infragistics.lob-16.1.js:68700
(anonymous function) @ jquery-ui-1.10.3.js:401
$.widget._mouseDown @ infragistics.lob-16.1.js:67923
(anonymous function) @ jquery-ui-1.10.3.js:401
proxy @ jquery-1.9.1.js:818jQuery.event.dispatch @ jquery-1.9.1.js:3074
elemData.handle @ jquery-1.9.1.js:2750
this._actElement