call onPostCreate before we insert the new item into the store
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 13 May 2009 20:29:54 +0000 (20:29 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 13 May 2009 20:29:54 +0000 (20:29 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@13156 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/js/dojo/openils/widget/AutoGrid.js

index a344437..f984216 100644 (file)
@@ -285,10 +285,10 @@ if(!dojo._hasResource['openils.widget.AutoGrid']) {
                     disableWidgetTest : this.disableWidgetTest,
                     onPostSubmit : function(r) {
                         var fmObject = openils.Util.readResponse(r);
-                        if(fmObject) 
-                            grid.store.newItem(fmObject.toStoreItem());
                         if(grid.onPostCreate)
                             grid.onPostCreate(fmObject);
+                        if(fmObject) 
+                            grid.store.newItem(fmObject.toStoreItem());
                         setTimeout(function(){
                             try {
                                 grid.selection.select(grid.rowCount-1);