cybertools/composer/schema/grid/grid_macros.pt
helmutm 7eddce81ac provide new RecordsField; add a method to the ActionsRegistry for overwriting settings
git-svn-id: svn://svn.cy55.de/Zope3/src/cybertools/trunk@3221 fd906abe-77d9-0310-91a1-e0d9ade77398
2009-02-09 16:29:14 +00:00

70 lines
2.6 KiB
XML
Executable file

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US"
i18n:domain="cybertools.composer.schema">
<body>
<metal:input define-macro="input_grid"
tal:define="fieldInstance python: field.getFieldInstance(view.instance);
columns fieldInstance/columnTypes">
<script type="text/javascript" language="JavaScript"
tal:content="string:
data_$name = dojo.fromJson('${data/?name}');
store_$name = new dojo.data.ItemFileWriteStore({data: data_$name});
store_$name._saveEverything = function(ccb, ecb, data) {
dojo.byId('$name').value = data;
};
dojo.connect(dojo.byId('editForm'), 'onsubmit', function(evt) {
dijit.byId('grid_$name').edit.apply();
store_$name.save();
});">
</script>
<textarea rows="3" style="display: none"
tal:attributes="name name; id name">
</textarea>
<table dojoType="dojox.grid.DataGrid"
style="width: 100%; height: 12em"
singleClickEdit="true"
tal:attributes="id string:grid_$name;
store string:store_$name">
<thead>
<tr>
<tal:header repeat="column columns">
<th width="auto" editable="true"
tal:attributes="field column/name"
tal:content="column/title">Column Title</th>
</tal:header>
</tr></thead>
</table><br />
</metal:input>
<metal:input define-macro="input_records"
tal:define="fieldInstance python: field.getFieldInstance(view.instance);
columns fieldInstance/columnTypes">
<table>
<tr>
<tal:header repeat="column columns">
<th width="auto" editable="true"
tal:attributes="field column/name"
tal:content="column/title">Column Title</th>
</tal:header>
</tr>
<tr tal:repeat="row data/?name">
<td tal:repeat="column columns">
<input type="text" size="14"
tal:define="cname column/name"
tal:attributes="value row/?cname;
name string:$name.$cname:records" /></td>
</tr>
<tr tal:attributes="id string:$name.empty">
<td tal:repeat="column columns">
<input type="text" size="14"
tal:define="cname column/name"
tal:attributes="name string:$name.$cname:records" /></td>
</tr>
</table><br />
</metal:input>
</body>
</html>