summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrédéric Péters <fpeters@entrouvert.com>2014-02-24 08:45:31 (GMT)
committerFrédéric Péters <fpeters@entrouvert.com>2014-02-24 08:45:31 (GMT)
commit7e1de4e4baf52179c864c8df6212cd32ca3ca434 (patch)
tree750ade6193bdcefa0ee3c6234d67196789b1fc3d
parentccb4bc2398e50d56afce13c34002f29942850133 (diff)
downloadpfwbged.contact-7e1de4e4baf52179c864c8df6212cd32ca3ca434.zip
pfwbged.contact-7e1de4e4baf52179c864c8df6212cd32ca3ca434.tar.gz
pfwbged.contact-7e1de4e4baf52179c864c8df6212cd32ca3ca434.tar.bz2
make it possible to sort table
-rw-r--r--src/pfwbged/contact/table.pt9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/pfwbged/contact/table.pt b/src/pfwbged/contact/table.pt
index f261432..6b96b90 100644
--- a/src/pfwbged/contact/table.pt
+++ b/src/pfwbged/contact/table.pt
@@ -26,6 +26,10 @@
<div id="searchresults"/>
+ <div style="display: none;">
+ <input id="sort_on" value="sortable_title"/>
+ <input id="sort_order" type="checkbox"/>
+ </div>
</div>
@@ -52,7 +56,10 @@ $.querywidget.updateSearch = function () {
}
query += "query.i:records=SearchableText&query.o:records=plone.app.querystring.operation.string.contains&query.v:records=";
query += $('input[name="text-criteria-fulltext"]').val();
- query += '&sort_on=sortable_title';
+ query += '&sort_on=' + $('#sort_on').val();
+ if ($('#sort_order:checked').length > 0) {
+ query += '&sort_order=reverse';
+ }
$.querywidget.runQuery(query);
};