make it possible to sort table

This commit is contained in:
Frédéric Péters 2014-02-24 09:45:31 +01:00
parent ccb4bc2398
commit 7e1de4e4ba
1 changed files with 8 additions and 1 deletions

View File

@ -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);
};