From 4089a89bf65bd17e922266938133fc6b0093cd40 Mon Sep 17 00:00:00 2001 From: Renaud Le Gac <legac@cppm.in2p3.fr> Date: Thu, 5 Jun 2014 19:38:03 +0200 Subject: [PATCH] Add the configuration panelLoader to the BaseWithSelector class. --- models/widgets_viewport.py | 1 + static/plugin_dbui/CHANGELOG | 2 ++ static/plugin_dbui/src/panel/BaseWithSelector.js | 14 +++++++++++++- views/reports/report_2.html | 3 +++ 4 files changed, 19 insertions(+), 1 deletion(-) diff --git a/models/widgets_viewport.py b/models/widgets_viewport.py index 81bd9bfa..909a3cea 100644 --- a/models/widgets_viewport.py +++ b/models/widgets_viewport.py @@ -72,6 +72,7 @@ leaf_2 = PanelWithUrlSelector(virtdb.foo1, baseUrl=URL('reports', 'report_2'), baseParams={'hello': 3}, extField='my_format', + panelLoader={"renderer": "html", "scripts": True}, plugins=['pMathJax']) leaf_3 = PanelWithUrlSelector(virtdb.harvester_selector, diff --git a/static/plugin_dbui/CHANGELOG b/static/plugin_dbui/CHANGELOG index f74c1d06..c6c5172b 100644 --- a/static/plugin_dbui/CHANGELOG +++ b/static/plugin_dbui/CHANGELOG @@ -1,6 +1,8 @@ --------------------------------- CHANGE LOG ---------------------------------- HEAD + - Add protection in CLEAN_COMMA and CLEAN_SPACES. + - Add the configuration panelLoader to BaseWithSelector. 0.6.1.1 (Mar 2014) - Consolidation version diff --git a/static/plugin_dbui/src/panel/BaseWithSelector.js b/static/plugin_dbui/src/panel/BaseWithSelector.js index 073bc8dd..1acc6a2b 100644 --- a/static/plugin_dbui/src/panel/BaseWithSelector.js +++ b/static/plugin_dbui/src/panel/BaseWithSelector.js @@ -50,6 +50,18 @@ Ext.define('App.panel.BaseWithSelector', { */ panelDefaults: null, + /** + * @cfg {Ext.ComponentLoader/Object} + * A configuration object or an instance of a {@link Ext.ComponentLoader} + * to load remote content for this Component. By default, the content + * loaded will be processed as raw html. The response text from the + * request is taken and added to the component. This can be used in + * conjunction with the scripts option to execute any inline scripts + * in the resulting content. + * + */ + panelLoader: {}, + /** * @cfg {Object} * The selector items. @@ -143,7 +155,7 @@ Ext.define('App.panel.BaseWithSelector', { itemId: 'mainPanel', items: this.panelItems, layout: 'fit', - loader: {}, + loader: this.panelLoader, plugins: ['pPanelLoaderException'], region: 'center' }, { diff --git a/views/reports/report_2.html b/views/reports/report_2.html index def402bd..9bfed297 100644 --- a/views/reports/report_2.html +++ b/views/reports/report_2.html @@ -6,3 +6,6 @@ <h4>request.vars:</h4> {{=BEAUTIFY(vars)}} <hr> +<script type="text/javascript"> + Ext.Msg.alert("Hello", "Execute inline script"); +</script> -- GitLab