List of Sortable Items
This page uses a Hashtag List with a Sort directive.
The Table is styled using Bootstrap 3 default theme classes.
Methods are provided to Edit or Delete any Sortable Item.
Processed this Hashtag Markup:
<# start list for sortable items;
sort by sort order as numeric, name;
#>
<# start header #>
<table class="table table-striped table-hover" id="table">
<thead>
<tr>
<th>Created On</th>
<th>Name</th>
<th>Sort Order</th>
<th>Action</th>
</tr>
</thead>
<# end header #>
<# start row #>
<tr>
<td><# created on #></td>
<td><# name as html #></td>
<td><# sort order as html #></td>
<td><a href="form?edit=<# id #>&land=ascending-numeric"
class=label label-primary">Edit</a>
<a href="delete?id=<# id #>&index=<#[url.index as html]#>&land=ascending-numeric"
onclick="return confirm('Delete Sortable Item record?')"
class="label label-primary">Delete</a>
</td>
</tr>
<# end row #>
<# start footer #>
</table>
<# end footer #>
<# no results #>
<# redirect to "/lists/sort/purge?land=ascending-numeric"; #>
<# end no results #>
<# end list #>
Hashtag Markup for Delete Action:
/lists/sort/delete
<# delete record for "sortable_items.<#[url.id]#>";
redirect to "/lists/sort/<#[url.land as url]#>?index=<#[url.index as url]#>#table";
#>