Handle grid_update via post_* function variables so particular pages
authorJoey Schulze <joey@infodrom.org>
Wed, 10 Mar 2010 15:30:40 +0000 (16:30 +0100)
committerJoey Schulze <joey@infodrom.org>
Wed, 10 Mar 2010 15:30:40 +0000 (16:30 +0100)
can handle things different

lib/functions.js

index 1d7aa0b..11387fe 100644 (file)
@@ -121,16 +121,23 @@ function form_init()
            form.children[i].value = '';
 }
 
+var post_save = function() { grid_update(grid); }
+var post_delete = function() { grid_update(grid); }
+
 function save_callback(data)
 {
     info('Datensatz gespeichert');
-    grid_update(grid);
+
+    if (typeof post_save == 'function')
+       post_save();
 }
 
 function delete_callback(data)
 {
     info('Datensatz gelöscht');
-    grid_update(grid);
+
+    if (typeof post_delete == 'function')
+       post_delete();
 }
 
 function form_save(obj)