Making sure focus is set properly when tabbing through fields in the datatable editor

This commit is contained in:
Paul Driver 2009-06-03 15:36:57 +00:00
parent a5bdf1d5ab
commit 7e51ddd3b2

View file

@ -132,8 +132,10 @@ WebGUI.Form.DataTable
*/
this.handleEditorShowEvent
= function ( obj ) {
obj.editor.focus();
setTimeout( obj.editor.focus, 500 );
/* If we set the focus now, something might (and sometimes does) set
* it later in the event handling chain. Let's defer the focus set
* until this chain is finished. */
setTimeout(function() { obj.editor.focus() }, 0);
};
/************************************************************************
@ -144,7 +146,6 @@ WebGUI.Form.DataTable
= function () {
var row = this.dataTable.getLastTrEl();
this.dataTable.showCellEditor( row.firstChild );
this.dataTable.getCellEditor().focus();
};
/************************************************************************