in reply to Re^2: How to let a user sort a list on a web page
in thread How to allow a user to reorder rows from a database using a web form?
I didn't appreciate that this was the kind of sorting you were looking for, however I'm glad you've found this useful. You'll notice this example code from the jQuery page works as is, you don't need any Perl module to make it work. Using CGI (or CGI::Application or your framework of choice) you can output dynamic content. You simply include this example jQuery code in the output you send to the browser.
I'd suggest using a templating system such as HTML::Template or Template::Toolkit to separate your Perl code from the HTML/CSS/JavaScript code. If you look at the HTML::Template documentation you'll notice the <TMPL_LOOP> tag which you could use to populate your sortable data (in the example above each row is a HTML <li>, list item).
I'd also suggest that you benchmark performance of this method with your dataset and compare it to the performance of the datatable plugins I mentioned previously.
|
---|
Replies are listed 'Best First'. | |
---|---|
cgi scripts running javascript and passing control back and forth
by yaconsult (Acolyte) on Jan 04, 2011 at 16:58 UTC | |
by marto (Cardinal) on Jan 04, 2011 at 22:20 UTC | |
by yaconsult (Acolyte) on Jan 05, 2011 at 02:26 UTC | |
by Anonymous Monk on Jan 05, 2011 at 03:41 UTC | |
by marto (Cardinal) on Jan 05, 2011 at 09:00 UTC | |
by yaconsult (Acolyte) on Jan 05, 2011 at 23:35 UTC | |
|