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

The version view use an Ext.data.Store instead of an Ext.data.ArrayStore.

parent 8c38d139
No related branches found
No related tags found
No related merge requests found
......@@ -417,15 +417,14 @@ def versions():
"""Return the versions of the different part of the code.
"""
from plugin_dbui import get_versions
from plugin_dbui import get_versions, Store
# the configuration for the Ext.data.ArrayStore
cfg = dict()
cfg['fields'] = [{'name': 'code', 'type': 'string'},
{'name': 'version', 'type': 'string'}]
# the configuration for the Ext.data.Store
cfg = Store()
cfg['data'] = get_versions()
cfg.fields = [dict(name='code', type='string'),
dict(name='version', type= 'string')]
cfg.data = get_versions()
return dict(cfg_store=json.dumps(cfg))
......@@ -545,9 +545,9 @@ def get_store_id(name):
def get_versions():
"""Get the versions of the application and plugins.
@rtype: list of tuple
@return: each tuple contains the name of the software
and its version identifier.
@rtype: list of dict
@return: each dictionary contains the name of the software
and its version identifier. The keys are C{code} and C{version}
"""
server_path, client_path = get_reference_paths()
......@@ -629,12 +629,12 @@ def get_versions():
os.chdir(ref_path)
# prepare the output
li = [("web2py", web2py),
("dbui", dbui),
("extjs", extjs),
("mathjax", mathjax),
("ace", ace),
(current.request.application, myapp)]
li = [dict(code="web2py", version=web2py),
dict(code="dbui", version=dbui),
dict(code="extjs", version=extjs),
dict(code="mathjax", version=mathjax),
dict(code="ace", version=ace),
dict(code=current.request.application, version=myapp)]
return li
......
......@@ -13,19 +13,23 @@
#
# unique identifier for the DIV block associated to the grid
#
divgrid = id(cfg_store)
divgrid = "grid-%s" % id(cfg_store)
#
# The title and the DIV block
#
response.write(H2(T("Software versions"), _class="dbui-h2 dbui-small-cap"))
response.write(DIV(_id="grid-%s" % divgrid))
response.write(DIV(_id=divgrid))
#
# Export python variables to the javascript
#
jsvars = "var cfgStore = %s;" % cfg_store
jsvars = ["cfgStore = %s" % cfg_store,
"divgrid = '%s'" % divgrid]
jsvars = " var %s;" % ',\n'.join(jsvars)
response.write(SCRIPT(jsvars), escape=False)
}}
<script>
......@@ -34,9 +38,10 @@
// instantiate the grid showing version numbers
//
var grid = Ext.create('Ext.grid.Panel', {
console.log(1, cfgStore);
var grid = Ext.create('App.grid.Panel', {
plugins: ['pGridExport'],
store: Ext.create('Ext.data.ArrayStore', cfgStore),
store: cfgStore,
columns: [
{text: "Software", dataIndex: 'code', flex: 0.8},
{text: "Version", dataIndex: 'version', flex: 1.2}
......@@ -44,7 +49,7 @@
forceFit: true,
hideHeaders: true,
padding: "10 40 20 60",
renderTo: 'grid-{{=divgrid}}',
renderTo: divgrid,
width: 300
});
......
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