Unwanted side effects in _formOptions
Unwanted side effects in _formOptions
Editor contains the following code:
// Start a full row edit, but don't display - we will be showing the field
this._edit( cell, editFields, 'inline' );
var namespace = this._formOptions( opts );
var ret = this._preopen( 'inline' );
if ( ! ret ) {
return this;
}
I don't understand exactly what this._formOptions( opts ) does, but I think the call should happen after the preOpen event.
// Start a full row edit, but don't display - we will be showing the field
this._edit( cell, editFields, 'inline' );
var ret = this._preopen( 'inline' );
if ( ! ret ) {
return this;
}
var namespace = this._formOptions( opts );
I forgot what issue this change fixed for me. All I remember is that _formOptions performs some side effect(s) that should not occur if _preopen returns false.
This discussion has been closed.
Replies
The
_formOptionsmethod provides common handling for the various form types such as setting buttons, titles, etc. The fact thatpreOpenhappens after it allows that event to override those options.Allan
That makes sense, but then why is the order of events different for bubble forms?
Inside
Editor.prototype.bubble:Inside
Editor.prototype.inline:I remember a little more about my problem:
The call to
_formOptionsattaches a handler forkeydownevents in the page. This conflicts with KeyTable (somehow), especially when thepreOpenevent is cancelled by user code.I recall a similar issue in KeyTable that was fixed in the last release by adding a
cancelOpenevent. Maybe_formOptionsshould also listen for that event?That's a bug - thanks for pointing it out. It should be consistent.
Yes, it sounds like
preOpenbeing cancelled might be causing a problem in the bubble as well.Allan
Hi,
Quick update on this one. I've committed fixes for both issues and they will be in 1.6.3. Thanks again for letting me know about these!
Regards,
Allan