diff --git a/static/plugin_dbui/lib/appviewportintreegrid.js b/static/plugin_dbui/lib/appviewportintreegrid.js index 08ffbf4c549c8d92254030295d9cbe9b6df9753e..0aa4e06bae1924cbdb411cf0b06da96e66f7777b 100644 --- a/static/plugin_dbui/lib/appviewportintreegrid.js +++ b/static/plugin_dbui/lib/appviewportintreegrid.js @@ -50,8 +50,45 @@ App.viewport.InTreePanelGrid = Ext.extend(App.viewport.InTreePanelBase, { cfgSvc.getGridModel(table, function(provider,response){ var cfg = response.result; - var wdg = Ext.ComponentMgr.create(cfg); + var wdg = Ext.ComponentMgr.create(cfg); + if('filterModel' in cfg.model){ + console.debug(table); + // instantiate the grid and the filter + var grid = wdg; + var gridfilter = Ext.ComponentMgr.create(cfg.model.filterModel); + gridfilter.bind(grid); + + // embedded the grid and the filter in a panel + var wdg = new Ext.Panel({ + layout: 'border', + items: [{ + region: 'center', + layout: 'fit', + items: [grid], + }, { + region: 'east', + layout: 'form', + collapsible: true, + collapsed: true, + defaults: {anchor: '100%'}, + frame: true, + items: [gridfilter], + width: 300, + split: true, + buttons: [{text: 'reset', ref: '../../resetButton'}], + }], + }); + + // connect the reset button + wdg.resetButton.on('click', gridfilter.onReset, gridfilter); + + } else { + + // create a stand alone grid + + } + component.add(wdg); component.doLayout();