make it possible to sort search tables
This commit is contained in:
parent
ed6a0a08eb
commit
c86b6fe431
|
@ -93,6 +93,7 @@
|
|||
$.querywidget.updateBatchLinks(orig_query);
|
||||
$.querywidget.updateBatchSizeMenu();
|
||||
$.querywidget.updateExtraColumnsMenu();
|
||||
$.querywidget.updateTableHeaders();
|
||||
});
|
||||
};
|
||||
$.querywidget.updateBatchLinks = function (query) {
|
||||
|
@ -149,6 +150,20 @@
|
|||
return false;
|
||||
});
|
||||
};
|
||||
$.querywidget.updateTableHeaders = function (query) {
|
||||
$('#searchresults table th span[data-sortable]').each(function(i, elem) {
|
||||
var sort_on = $(elem).data('sortable');
|
||||
$(elem).parent().css('cursor', 'pointer').click(function() {
|
||||
if ($('#sort_on').val() == sort_on) {
|
||||
/* same column, reverse */
|
||||
$('#sort_order').click();
|
||||
} else {
|
||||
$('#sort_on').val(sort_on);
|
||||
}
|
||||
$.querywidget.updateSearch();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
$.querywidget.createWidgetOrig = $.querywidget.createWidget;
|
||||
$.querywidget.createWidget = function (type, index, fname) {
|
||||
|
|
Reference in New Issue