records field: evaluate style properties in edit form; use correct display macro
This commit is contained in:
parent
1ef004cd1c
commit
180ab86be6
2 changed files with 17 additions and 10 deletions
|
@ -42,37 +42,43 @@
|
||||||
tal:define="fieldInstance python: field.getFieldInstance(view.instance);
|
tal:define="fieldInstance python: field.getFieldInstance(view.instance);
|
||||||
columns fieldInstance/columnTypes;
|
columns fieldInstance/columnTypes;
|
||||||
rows data/?name">
|
rows data/?name">
|
||||||
<table class="records">
|
<table class="records" style="width: auto">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<tal:header repeat="column columns">
|
<tal:header repeat="column columns">
|
||||||
<th tal:attributes="field column/name;"
|
<th tal:attributes="class string:${column/baseField/cssClass|string:}"
|
||||||
tal:content="column/title">Column Title</th>
|
tal:content="column/title">Column Title</th>
|
||||||
</tal:header>
|
</tal:header>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody tal:attributes="id string:tbody.$name">
|
<tbody tal:attributes="id string:tbody.$name">
|
||||||
<tr tal:repeat="row rows">
|
<tr tal:repeat="row rows">
|
||||||
<td tal:repeat="column columns">
|
<td tal:repeat="column columns"
|
||||||
<input type="text"
|
tal:attributes="class string:${column/baseField/cssClass|string:}">
|
||||||
|
<input type="text" style="width: auto"
|
||||||
tal:define="cname column/name"
|
tal:define="cname column/name"
|
||||||
tal:attributes="value row/?cname;
|
tal:attributes="value row/?cname;
|
||||||
name string:$name.$cname:records;" /></td>
|
name string:$name.$cname:records;
|
||||||
|
style string:width: ${column/baseField/width|string:auto};" /></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tal:empty condition="python: not field.cardinality
|
<tal:empty condition="python: not field.cardinality
|
||||||
or field.cardinality > len(rows)">
|
or field.cardinality > len(rows)">
|
||||||
<tr>
|
<tr>
|
||||||
<td tal:repeat="column columns">
|
<td tal:repeat="column columns"
|
||||||
|
tal:attributes="class string:${column/baseField/cssClass|string:}">
|
||||||
<input type="text"
|
<input type="text"
|
||||||
tal:define="cname column/name"
|
tal:define="cname column/name"
|
||||||
tal:attributes="name string:$name.$cname:records" /></td>
|
tal:attributes="name string:$name.$cname:records;
|
||||||
|
style string:width: ${column/baseField/width|string:auto};" /></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr style="display: none"
|
<tr style="display: none"
|
||||||
tal:attributes="id string:$name.empty">
|
tal:attributes="id string:$name.empty">
|
||||||
<td tal:repeat="column columns">
|
<td tal:repeat="column columns"
|
||||||
<input type="text"
|
tal:attributes="class string:${column/baseField/cssClass|string:}">
|
||||||
|
<input type="text" style="width: auto"
|
||||||
tal:define="cname column/name"
|
tal:define="cname column/name"
|
||||||
tal:attributes="name string:$name.$cname:records" /></td>
|
tal:attributes="name string:$name.$cname:records;
|
||||||
|
style string:width: ${column/baseField/width|string:auto};" /></td>
|
||||||
</tr>
|
</tr>
|
||||||
</tal:empty>
|
</tal:empty>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|
|
@ -46,6 +46,7 @@ class Records(Grid):
|
||||||
__typeInfo__ = ('records',
|
__typeInfo__ = ('records',
|
||||||
FieldType('records', 'records',
|
FieldType('records', 'records',
|
||||||
u'A series of records or rows.',
|
u'A series of records or rows.',
|
||||||
|
displayRenderer='display_records',
|
||||||
instanceName='records',))
|
instanceName='records',))
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue