Skip to content
Snippets Groups Projects
Commit 98a5f254 authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

Add the configuration option panelLayout and selectorLayout to the

BasseWithSelector class.
parent 94315576
No related branches found
No related tags found
No related merge requests found
......@@ -39,4 +39,11 @@ def report_3():
"""
selector = Selector(virtdb.harvester_selector)
response.view = 'reports/report_2.html'
return dict(test=selector.as_dict())
\ No newline at end of file
return dict(test=selector.as_dict())
def report_4():
"""Execute a javascript in the view using python information
"""
return dict(msg="Hello world")
\ No newline at end of file
......@@ -89,6 +89,7 @@
'report_1': 'report_1',
'report_2': 'report_2',
'report_3': 'report_3',
'report_4': 'report_4',
'reports': 'rapports',
'Reports': 'Rapports',
'Select': 'Selectionner',
......
......@@ -72,7 +72,6 @@ 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,
......@@ -80,10 +79,14 @@ leaf_3 = PanelWithUrlSelector(virtdb.harvester_selector,
selectorRegion='east',
selectorTitle='Select a project')
leaf_4 = PanelWithUrlSelector(virtdb.foo1,
baseUrl=URL('reports', 'report_4'))
reportNode = Node(T('Reports'))
reportNode.add_child(T('report_1'), leaf_1)
reportNode.add_child(T('report_2'), leaf_2)
reportNode.add_child(T('report_3'), leaf_3)
reportNode.add_child(T('report_4'), leaf_4)
#-------------------------------------------------------------------------------
#
......
......@@ -36,22 +36,33 @@ Ext.define('App.panel.BaseWithSelector', {
/**
* @cfg {Object}
* The main panel items.
* The items configuration option for the main panel.
*/
panelItems: null,
/**
* @cfg {Boolean}
* The border configuration option for the main panel.
*
*/
panelBorder: false,
/**
* @cfg {Object}
* The defaults configuration option for the main panel.
*/
panelDefaults: null,
/**
* @cfg {Ext.enums.Layout/Object}
* The layout configuration option for the main panel.
*/
panelLayout: 'fit',
/**
* @cfg {Ext.ComponentLoader/Object}
* The laoder configuration option for the selector.
*
* 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
......@@ -60,34 +71,47 @@ Ext.define('App.panel.BaseWithSelector', {
* in the resulting content.
*
*/
panelLoader: {},
panelLoader: {
renderer: 'html',
scripts: true
},
/**
* @cfg {Object}
* The selector items.
* The items configuration option for the selector.
*/
selectorItems: null,
/**
* @cfg {Boolean}
* The collapsible configuration option for the selector.
*/
selectorCollapsible: true,
/**
* @cfg {Object}
* The defaults configuration option for the selector.
*/
selectorDefaults: {layout: 'form', padding: '0 10 10 10'},
/**
* @cfg {Boolean}
* The frame configuration option for the selector.
*/
selectorFrame: true,
/**
* @cfg {Number}
* The height configuration option for the selector.
*/
selectorHeight: 300,
/**
* @cfg {Ext.enums.Layout/Object}
* The layout configuration option for the selector.
*/
selectorLayout: 'form',
/**
* @cfg {String}
* Authorized values are east, west, south and north.
......@@ -96,40 +120,43 @@ Ext.define('App.panel.BaseWithSelector', {
/**
* @cfg {Boolean}
* The split configuration option for the selector.
*/
selectorSplit: true,
/**
* @cfg {String}
* The title configuration option for the selector.
*/
selectorTitle: "Selector",
/**
* @cfg {Number}
* The width configuration option for the selector.
*/
selectorWidth: 300,
/**
* @property {Ext.Button}
* The reference to the *go* button of the selector
* The reference to the *go* button of the selector.
*/
goButton: null,
/**
* @property {Ext.Button}
* The reference to the *reset* button of the selector
* The reference to the *reset* button of the selector.
*/
resetButton: null,
/**
* @property {Ext.panel.Panel}
* reference to the mainPanel
* reference to the mainPanel.
*/
mainPanel: null,
/**
* @property {Ext.panel.Panel}
* reference to the selectorPanel
* reference to the selectorPanel.
*/
selectorPanel: null,
......@@ -154,7 +181,7 @@ Ext.define('App.panel.BaseWithSelector', {
defaults: this.panelDefaults,
itemId: 'mainPanel',
items: this.panelItems,
layout: 'fit',
layout: this.panelLayout,
loader: this.panelLoader,
plugins: ['pPanelLoaderException'],
region: 'center'
......@@ -171,7 +198,7 @@ Ext.define('App.panel.BaseWithSelector', {
defaults: this.selectorDefaults,
frame: this.selectorFrame,
height: this.selectorHeight,
layout: 'form',
layout: this.selectorLayout,
itemId: 'selectorPanel',
items: this.selectorItems,
region: this.selectorRegion,
......
......@@ -5,7 +5,4 @@
<hr>
<h4>request.vars:</h4>
{{=BEAUTIFY(vars)}}
<hr>
<script type="text/javascript">
Ext.Msg.alert("Hello", "Execute inline script");
</script>
<hr>
\ No newline at end of file
{{=msg}}
<script type="text/javascript">
var v1 = "{{=msg}}";
Ext.Msg.alert("Execute inline script", v1);
</script>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment