let columns be sorted

This commit is contained in:
Frédéric Péters 2014-02-24 09:37:54 +01:00
parent 4d722af029
commit 5817f2e75f
1 changed files with 10 additions and 1 deletions

View File

@ -15,6 +15,12 @@
<input type="hidden" name="folder_intid" tal:attributes="value context/intid"/>
<div id="searchresults"/>
<div style="display: none;">
<input id="sort_on" value="sortable_title"/>
<input id="sort_order" type="checkbox"/>
</div>
<script>
$.querywidget.updateSearch = function () {
var context_url = (function() {
@ -30,7 +36,10 @@ $.querywidget.updateSearch = function () {
var query = context_url + "/@@querybuilder_html_results?";
query += "query.i:records=object_folders&query.o:records=plone.app.querystring.operation.int.is&query.v:records:list=";
query += $("input[name='folder_intid']").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);
};