Commit 1eecff18 authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

Few minor improvements.

parent 5bac85ef
......@@ -226,7 +226,7 @@
'Order by': 'Trié par',
'Orderby': 'Trié par',
'Origin': 'Origin',
'Page generated in %s seconds': 'Page generated in %s seconds',
'Page generated in %s seconds': 'Page générée en %s seconds',
'Password': 'Mot de passe',
"Password fields don't match": "Password fields don't match",
'People': 'Personnes',
......
......@@ -94,13 +94,19 @@ def ON_CREATE_LISTS2(values):
df = func(**criteria)
# generate the configuration for Ext.grid.column.Column
if df.empty:
return False
lst = [dict(xtype="rownumberer"),
dict(dataIndex="?",
flex=1,
hidden=False,
text="?",
xtype="gridcolumn")]
# generate the configuration for Ext.grid.column.Column
lst = to_extjs_gridcolumns(df)
values["columns"] = json.dumps(lst, indent=4, sort_keys=True)
else:
lst = to_extjs_gridcolumns(df)
values["columns"] = json.dumps(lst, indent=4, sort_keys=True)
return False
......
......@@ -1279,7 +1279,7 @@ class Timer(object):
print '\n%s\n\telapsed time: %f ms' % (self.msg, self.msecs)
def to_extjs_gridcolumns(df):
def to_extjs_gridcolumns(df, meta=False):
"""Introspect the DataFrame in order to derive configuration for
``Ext.grid.column.Column`` which are used by an ``Ext.grid.Panel``.
......@@ -1293,6 +1293,7 @@ def to_extjs_gridcolumns(df):
Args:
df (pandas.DataFrame):
meta (bool): add column with metadata identifier when true
Returns:
list:
......@@ -1313,6 +1314,9 @@ def to_extjs_gridcolumns(df):
cfg.dataIndex = cfg.text = colname
if colname.startswith("id"):
if not meta:
continue
cfg.flex = 0.5
cfg.format = "0"
cfg.hidden = True
......
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