make it possible to sort table
This commit is contained in:
parent
ccb4bc2398
commit
7e1de4e4ba
|
@ -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);
|
||||
};
|
||||
|
||||
|
|
Reference in New Issue