Commit d0348285 authored by Jérome Perrin's avatar Jérome Perrin

if REQUEST.other contains ${form_id}/${listbox_id}/ListBox_getColumnWithDict...

if REQUEST.other contains ${form_id}/${listbox_id}/ListBox_getColumnWithDict magic key, this will be used as column width, instead of calculating.
This hack can be used for optimisation, or forcing column size of the same listbox rendered multiple times.



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@11784 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 776ca17f
...@@ -68,7 +68,16 @@ ...@@ -68,7 +68,16 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>N_ = context.Base_translateString\n <value> <string># if REQUEST.other contains ${form_id}/${listbox_id}/ListBox_getColumnWithDict\n
# magic key, this will be used as column width, instead of calculating.\n
if listbox is not None:\n
cache = context.REQUEST.other.get(\n
\'%s/%s/ListBox_getColumnWithDict\' % (\n
listbox.aq_parent.getId(), listbox.getId()), None)\n
if cache is not None:\n
return cache\n
\n
N_ = context.Base_translateString\n
\n \n
# XXX this is just a copy / paste of the old implementation\n # XXX this is just a copy / paste of the old implementation\n
# dirty code : if we are in domain or report tree, just use the old one, otherwise\n # dirty code : if we are in domain or report tree, just use the old one, otherwise\n
...@@ -183,7 +192,7 @@ return result\n ...@@ -183,7 +192,7 @@ return result\n
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>listboxline_list, is_domain_tree_mode, is_report_tree_mode, frame_width = 19.0, section_width = 4.0</string> </value> <value> <string>listboxline_list, is_domain_tree_mode, is_report_tree_mode, frame_width=19.0, section_width=4.0, listbox=None</string> </value>
</item> </item>
<item> <item>
<key> <string>errors</string> </key> <key> <string>errors</string> </key>
...@@ -203,7 +212,7 @@ return result\n ...@@ -203,7 +212,7 @@ return result\n
<dictionary> <dictionary>
<item> <item>
<key> <string>co_argcount</string> </key> <key> <string>co_argcount</string> </key>
<value> <int>5</int> </value> <value> <int>6</int> </value>
</item> </item>
<item> <item>
<key> <string>co_varnames</string> </key> <key> <string>co_varnames</string> </key>
...@@ -214,8 +223,11 @@ return result\n ...@@ -214,8 +223,11 @@ return result\n
<string>is_report_tree_mode</string> <string>is_report_tree_mode</string>
<string>frame_width</string> <string>frame_width</string>
<string>section_width</string> <string>section_width</string>
<string>listbox</string>
<string>None</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>context</string> <string>context</string>
<string>cache</string>
<string>N_</string> <string>N_</string>
<string>result</string> <string>result</string>
<string>min_column_width</string> <string>min_column_width</string>
...@@ -224,7 +236,6 @@ return result\n ...@@ -224,7 +236,6 @@ return result\n
<string>line_width</string> <string>line_width</string>
<string>col_count</string> <string>col_count</string>
<string>column_property</string> <string>column_property</string>
<string>None</string>
<string>string_property</string> <string>string_property</string>
<string>str</string> <string>str</string>
<string>len</string> <string>len</string>
...@@ -259,6 +270,7 @@ return result\n ...@@ -259,6 +270,7 @@ return result\n
<tuple> <tuple>
<float>19.0</float> <float>19.0</float>
<float>4.0</float> <float>4.0</float>
<none/>
</tuple> </tuple>
</value> </value>
</item> </item>
......
...@@ -89,7 +89,7 @@ ...@@ -89,7 +89,7 @@
</tal:block>\n </tal:block>\n
\n \n
\n \n
<tal:block tal:define="global column_width python:here.ListBox_getColumnWithDict(listboxline_list, is_domain_tree_mode, is_report_tree_mode, frame_width=frame_width)"/>\n <tal:block tal:define="global column_width python:here.ListBox_getColumnWithDict(listboxline_list, is_domain_tree_mode, is_report_tree_mode, frame_width=frame_width, listbox=listbox)"/>\n
\n \n
<table splitbyrow="1" repeatrows="1" repeatcols="0" style="StandardTableWithGrid">\n <table splitbyrow="1" repeatrows="1" repeatcols="0" style="StandardTableWithGrid">\n
\n \n
......
15 16
\ No newline at end of file \ No newline at end of file
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