diff --git a/static/scripts/grid_0.js b/static/scripts/grid_0.js new file mode 100644 index 0000000000000000000000000000000000000000..3f49a48f700e823f834219eb29e29b7eff36de3e --- /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