[open-ils-commits] r12120 - trunk/Open-ILS/web/js/dojo/openils/widget (erickson)
svn at svn.open-ils.org
svn at svn.open-ils.org
Mon Feb 9 13:47:28 EST 2009
Author: erickson
Date: 2009-02-09 13:47:25 -0500 (Mon, 09 Feb 2009)
New Revision: 12120
Modified:
trunk/Open-ILS/web/js/dojo/openils/widget/AutoGrid.js
Log:
can now specify post update and create handlers. wrap re-focus in try
Modified: trunk/Open-ILS/web/js/dojo/openils/widget/AutoGrid.js
===================================================================
--- trunk/Open-ILS/web/js/dojo/openils/widget/AutoGrid.js 2009-02-09 18:09:43 UTC (rev 12119)
+++ trunk/Open-ILS/web/js/dojo/openils/widget/AutoGrid.js 2009-02-09 18:47:25 UTC (rev 12120)
@@ -85,8 +85,17 @@
grid.store.setValue(storeItem, field, fmObject[field]());
}
dialog.destroy();
- setTimeout(function(){
- grid.views.views[0].getCellNode(rowIndex, 0).focus();},200);
+
+ if(self.onPostUpdate)
+ self.onPostUpdate(storeItem, rowIndex);
+
+ setTimeout(
+ function(){
+ try {
+ grid.views.views[0].getCellNode(rowIndex, 0).focus();
+ } catch (E) {}
+ },200
+ );
},
onCancel : function() {
setTimeout(function(){
@@ -108,9 +117,13 @@
if(fmObject)
grid.store.newItem(fmObject.toStoreItem());
dialog.destroy();
+ if(grid.onPostCreate)
+ grid.onPostCreate(fmObject);
setTimeout(function(){
- grid.selection.select(grid.rowCount-1);
- grid.views.views[0].getCellNode(grid.rowCount-1, 1).focus();
+ try {
+ grid.selection.select(grid.rowCount-1);
+ grid.views.views[0].getCellNode(grid.rowCount-1, 1).focus();
+ } catch (E) {}
},200);
},
});
More information about the open-ils-commits
mailing list