This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
Example: Use TableEditor to manage simple lists
Only in Lift 1.1
TableEditor comes with lift 1.1, thus this code wont work with lift 1.0 web app. Consider checking Upgrading 1.0 → 1.1 how to upgrade to 1.1 to get fancy and supereasy table editor working.
Boot
In Boot (besides adding the page below to the menu as usual):
TableEditor.registerTable("Hospital", Hospital, "Edit hospitals")
There are three parameters. The name to register the table as, to reference in the view; the MetaMapper instance; and the title, as used by the <table:title> tags below.
Layout
In a view, for a quick and simple layout (we use a template with eager_eval):
<lift:TableEditor.edit form="post" table="Hospital" eager_eval="true">
<lift:embed what="/tableeditor/default" />
</lift:TableEditor.edit>
To understand how to customize the layout, we show the contents of the template referenced above.
Note that the table attribute is the first argument to registerTable above.
<lift:TableEditor.edit form="POST" table="Hospital">
<head>
<title><table:title /></title>
</head>
<h3><table:title /></h3>
<table>
<tr>
<header:fields>
<td><field:name /></td>
</header:fields>
<td><table:insertBtn /></td>
</tr>
<tr>
<td colspan="5">
<hr />
</td>
</tr>
<table:items>
<tr>
<item:fields>
<td style="vertical-align: top"><field:form /></td>
</item:fields>
<td style="vertical-align: top"><item:removeBtn /></td>
</tr>
<tr>
<td colspan="5">
<hr />
</td>
</tr>
</table:items>
</table>
<table:saveBtn />
</lift:TableEditor.edit>






