[Dancer-users] Dancer::Plugin::SimpleCRUD - more features
Assaf Gordon
gordon at cshl.edu
Tue Oct 18 00:39:56 CEST 2011
Hi,
I've added couple of more features to make the awesome SimpleCRUD even more awesome (but hopefully still keeping it simple):
1. Add "sortable" feature: each column header becomes clickable, and allows the user to sort (ascending/descending) the results:
https://github.com/agordon/Dancer-Plugin-SimpleCRUD/commit/d03c298672d053f05346a10219649a62e1ca60c7
https://github.com/agordon/Dancer-Plugin-SimpleCRUD/commit/78403b81e7ceb860eb858aadc8029b93d918809c
2. Add "paginate" feature: show only X number of results, and add "next/prev page" links.
Badly needed if using SimpleCRUD for large tables.
https://github.com/agordon/Dancer-Plugin-SimpleCRUD/commit/13291c17d43e339802eea449aeff9f076eda6785
3. Make the search form select the last searched field by default:
https://github.com/agordon/Dancer-Plugin-SimpleCRUD/commit/df2ed60205d748012f170cdd8943d37318bdc577
4. Auto-focus keyboard input on the search field by default (but can be disabled by the user):
https://github.com/agordon/Dancer-Plugin-SimpleCRUD/commit/9211de64264720ddee15fc80573518a2a0673ef6
5. Add "downloadable" option, to download results as CSV/TXT/json/xml instead of showing as HTML.
https://github.com/agordon/Dancer-Plugin-SimpleCRUD/commit/42d8575840c2e1cb134082ca39a64b5bdae57ebc
You can experiment with these here:
http://cancan.cshl.edu/labmembers/gordon/simple_crud/genes
The code for the above website is:
============
package simple_crud_sortable;
use Dancer ':syntax';
use Dancer::Plugin::Database;
use Dancer::Plugin::SimpleCRUD;
our $VERSION = '0.1';
simple_crud(
record_title => "Gene",
prefix => "/genes",
db_table => "genes",
sortable => 1,
paginate => 300,
downloadable => 1,
editable => 0,
deletable => 0,
);
true;
============
Comments are welcomed,
-gordon
More information about the Dancer-users
mailing list