Dancer::Plugin::SimpleCRUD - more features
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/d03c298672d053f05... https://github.com/agordon/Dancer-Plugin-SimpleCRUD/commit/78403b81e7ceb860e... 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/13291c17d43e33980... 3. Make the search form select the last searched field by default: https://github.com/agordon/Dancer-Plugin-SimpleCRUD/commit/df2ed60205d748012... 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/9211de64264720dde... 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/42d8575840c2e1cb1... 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
On Monday 17 October 2011 23:39:56 Assaf Gordon wrote:
Hi,
I've added couple of more features to make the awesome SimpleCRUD even more awesome (but hopefully still keeping it simple):
[...]
Comments are welcomed, -gordon
Awesome work! Many thanks for that - I'll get that into D::P::SimpleCRUD and a new release out ASAP. You've addressed the features I've been meaning to add for some time, and made it far more useful - kudos! Feel free to submit a pull request through GitHub for the changes (although I should be able to add your repo as a remote and merge straight from that branch, so it shouldn't actually be necessary). Thanks again! Thanks also for the example of the new features in action - it's cool to see D::P::SimpleCRUD in use in an interesting field :) -- David Precious ("bigpresh") http://www.preshweb.co.uk/ "Programming is like sex. One mistake and you have to support it for the rest of your life". (Michael Sinz)
On Tuesday 18 October 2011 10:01:42 David Precious wrote:
On Monday 17 October 2011 23:39:56 Assaf Gordon wrote:
I've added couple of more features to make the awesome SimpleCRUD even more awesome (but hopefully still keeping it simple): [...]
Awesome work!
Many thanks for that - I'll get that into D::P::SimpleCRUD and a new release out ASAP. You've addressed the features I've been meaning to add for some time, and made it far more useful - kudos!
Feel free to submit a pull request through GitHub for the changes (although I should be able to add your repo as a remote and merge straight from that branch, so it shouldn't actually be necessary).
I've merged these changes from your branch and released 0.30 to CPAN - thanks again! -- David Precious ("bigpresh") http://www.preshweb.co.uk/ "Programming is like sex. One mistake and you have to support it for the rest of your life". (Michael Sinz)
Thank you, it is now again a step better. I tried to use it on my big tabel, with some rels and I did not found the way, how to handle foreign key fields which have NULLed. If i try to edit such row and submit it, seems that UPDATE tries to change NULL to empty ('') value and it is wrong: DBD::mysql::db do failed: Cannot add or update a child row: a foreign key constraint fails ... at Dancer/Plugin/Database/Handle.pm line 179. How to tell, that there is no need to change NULL to ''? -- Wbr, Kõike hääd, Gunnar
participants (3)
-
Assaf Gordon -
David Precious -
WK