Commit 51d9b204 authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

Add the view grid2.html.

parent c73e61ae
......@@ -21,7 +21,7 @@ def grid2():
title = do_title2(report)
response.view = "plugin_event/grid.html"
response.view = "plugin_event/grid2.html"
return dict(cfg_store=store, grid=grid, title=title)
{{
#--------------------------------------------------------------------------
#
# The python controller return the variables:
# - cfg_store (Storage)
# - grid (Storage)
# - title (string)
#
#--------------------------------------------------------------------------
# Prepare the data
# - The HTML tilte
# - The DIV blocks
# - Export python variables to javascript
#--------------------------------------------------------------------------
import json
from datetime import datetime
#
# The title and the DIV block
#
divgrid = "grid-%s" % id(cfg_store)
response.write(H2(title, _class="dbui-h2 dbui-small-cap"))
response.write(DIV(_id=divgrid))
#
# Convert store and grid configuration as string
#
cfg_grid = json.dumps(grid, cls=dbui.JSONEncoder)
cfg_store = json.dumps(cfg_store, cls=dbui.JSONEncoder)
#
# the footer, processing time of the request
#
delta = (datetime.now()-request.now).total_seconds()
delta = T('Processing time %s seconds') % round(delta, 2)
style = ["font-size: 10px;",
"margin-left: 10px;",
"margin-bottom: 3ex;",
"margin-top: 2ex;"]
response.write(P(delta, _style="".join(style)))
}}
<script type="text/javascript">
var cfgGrid = {{=XML(cfg_grid)}},
cfgStore = {{=XML(cfg_store)}},
columns = cfgGrid.columns,
features = cfgGrid.features,
divgrid = '{{=divgrid}}',
nColumns = columns.length,
i, grid;
// instantiate the grid
// NOTE ExtJS 6.2.0
// With ExtJS 6.2.0, the configuration is not working:
//
// plugins: ['pGridExport', 'pMathJax']
//
// It is related to layout and pMathJax !
// Remove pMathJax since its use is marginal in that application.
cfgGrid = Ext.apply(cfgGrid, {
plugins: ['pGridExport'],
store: cfgStore,
forceFit: true,
padding: "10 40 20 30",
renderTo: divgrid
});
Ext.create('Dbui.grid.Panel', cfgGrid);
</script>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment