From e145e37a324e8f63e652ac17f109058491f9dfff Mon Sep 17 00:00:00 2001 From: Renaud Le Gac <renaud.legac@free.fr> Date: Sun, 13 Mar 2011 10:19:19 +0000 Subject: [PATCH] Script to test a grid in the simplest case. --- static/scripts/grid_0.js | 47 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 static/scripts/grid_0.js diff --git a/static/scripts/grid_0.js b/static/scripts/grid_0.js new file mode 100644 index 00000000..3f49a48f --- /dev/null +++ b/static/scripts/grid_0.js @@ -0,0 +1,47 @@ +/** + * grid_0.js + * + * To test and debug grid widget -- the simplest case + * $Id$ + * + */ +Ext.namespace('App.grid'); + +/** + * main function + */ + +var main = function(provider, response){ + + var cfg, + grid, + vp; + + if (response instanceof String) { + Ext.Msg.alert('ERROR', response); + return; + } + + if (response.type === 'exception') { + Ext.Msg.alert('ERROR', response.xhr.statusText); + return; + } + + cfg = response.result; + cfg.plugins = ['pGridRowEditorContextMenu']; + + var vp = new Ext.Viewport({ + region: 'center', + layout: 'fit', + items: [cfg], + }); +}; + + +Ext.onReady(function(){ + + Ext.QuickTips.init(); + Ext.Direct.addProvider(App.REMOTE_API); + + Dbui.getGrid('countries', main) +}); \ No newline at end of file -- GitLab