Hi there. Found this toggle on the CRM appliance. Thought it would fit
perfectly on my app however this works properly, bringing the smart
table up and closing the form:
{{response.files.append(URL(r=request,c='static',f='jquery.dataTables.min.js'))}}
{{response.files.append(URL(r=request,c='static',f='demo_table.css'))}}
{{response.files.append(URL(r=request,c='static',f='formie.css'))}}
{{extend 'layout_manager.html'}}
<script>
jQuery(document).ready(function(){
jQuery('.smarttable').dataTable();
});
</script>
<h1>{{=employee.first_name}} {{=employee.last_name}} Timesheets</h1>
<br /><br />
[<a href="#nil" onclick="jQuery('#form').slideToggle();">toggle</a>]
<h2>New Timesheet</h2>
<div id="form">
{{=form}}
</div>
<br /><br />
<table class="smarttable">
<thead>
<tr>
<th>From</th><th>To</th><th>Total Hours</th><th>Signed By</th>
</tr>
</thead>
<tbody>
{{for timesheet in timesheets:}}
<tr>
<td>{{=honorario_timesheet(timesheet)}}</td>
<td>{{=timesheet.hastafecha}}</td>
<td>{{=timesheet.totalhours}}</td>
<td>{{=timesheet.signedby.first_name}}
{{=timesheet.signedby.last_name}}</td>
HOWEVER, this one below, not using a Crud, does toggles but brings
even the smart table up, closing both the forms and the smart table:
{{response.files.append(URL(r=request,c='static',f='jquery.dataTables.min.js'))}}
{{response.files.append(URL(r=request,c='static',f='demo_table.css'))}}
{{response.files.append(URL(r=request,c='static',f='formie.css'))}}
{{extend 'layout_manager.html'}}
<script>
jQuery(document).ready(function(){
jQuery('.smarttable').dataTable();
});
</script>
<h1>{{=employee.first_name}} {{=employee.last_name}} Timesheets</h1>
<br /><br />
[<a href="#nil" onclick="jQuery('#form').slideToggle();">toggle</a>]
<h2>New Timesheet</h2>
<div id="form">
{{=form.custom.begin}}
<div id="timesheet_form">
<table>
<tr><th> From:</th><td>
{{=form.custom.widget.desdefecha}} </td></tr>
<tr><th>To:</th><td>
{{=form.custom.widget.hastafecha}}</td></tr>
<tr><th>Sun</th><td>
{{=form.custom.widget.sun}}</td></tr>
<tr><th>Monw</th><td>
{{=form.custom.widget.monw}}</td><td>{{=form.custom.widget.mons}}</
td><td>{{=form.custom.widget.monv}}</td></tr>
<tr><th>Tuesw</th><td>
{{=form.custom.widget.tuesw}}</td><td>{{=form.custom.widget.tuess}}</
td><td>{{=form.custom.widget.tuesv}}</td></tr>
</table>
{{=form.custom.submit}}
{{=form.custom.end}}
</div>
<br /><br />
<table class="smarttable">
<thead>
<tr>
<th>From</th><th>To</th><th>Total Hours</th><th>Signed By</th>
</tr>
</thead>
<tbody>
{{for timesheet in timesheets:}}
<tr>
<td>{{=honorario_timesheet(timesheet)}}</td>
<td>{{=timesheet.hastafecha}}</td>
<td>{{=timesheet.totalhours}}</td>
<td>{{=timesheet.signedby.first_name}}
{{=timesheet.signedby.last_name}}</td>
Help appreciated
thanks