Replies
The previous version has a bug. This is my latest patch which uses internally the girds own public API which does the job. Here is the modification to the _mouseDown method :
_mouseDown: function (evt) {
…
if (this.isEditing()) {
// can be uncommented for blocking done/cancel buttons
//if (this.options.editMode === "cell" || !this.options.showDoneCancelButtons) {
// close editing if the end-user clicked somewhere else
// this will re-enable selection and allow for subsequent start edit which is
// at this point blocked indefinately because of the inability to select anything
if (!target.hasClass(this.css.editingCell) &&
(this.options.editMode === "cell" || this._getRowId(target.closest("tr")) !== this._editingForRowId)) {
// Here is the little modification which checks if we are in dialog mode.
if (this.options.editMode === "dialog") {
this.endEdit(false, true);
}
else {
this._endEdit(evt, true, false);
}
}
//}
}
…
},
I have solved it this way :
1. Uncomment some code as suggested in infragistics.lob in mouseDown event :
_mouseDown: function (evt) {
…..
if (this.isEditing()) {
// can be uncommented for blocking done/cancel buttons
//if (this.options.editMode === "cell" || !this.options.showDoneCancelButtons) {
// close editing if the end-user clicked somewhere else
// this will re-enable selection and allow for subsequent start edit which is
// at this point blocked indefinately because of the inability to select anything
if (!target.hasClass(this.css.editingCell) &&
(this.options.editMode === "cell" || this._getRowId(target.closest("tr")) !== this._editingForRowId)) {
this._endEdit(evt, true, false);
}
//}
…
},
this solves the problem partially – it moves the selection properly without closing the dialog and without crashing the grid.
2. Get the igGridUpdating in any following event and call manually endEdit();
In our case the edit dialog is displayed in different pane so the event which closes the dialog is not called and the focus is not returned back the right way. Then the whole selection functionality breaks down.