Я использую https://github.com/jbritten/jquery-tablesorter-filter, jquery table sorter plugin и таблицу сортировки сортировщика jquery.tablesorter-filter и jquery tablesorter
Когда я загружаю настройки в нагрузку документа и добавляю фильтр, он разрушает разбиение на страницы. У меня была эта проблема с каждым плагином фильтра для таблицы, который я пытался использовать.
var $table = $('#billing_summary_table')
.on('pagerInitialized pagerComplete', function (e, c) {
var i, pages = '', t = [],
cur = c.page + 1,
start = cur > 1 ? (c.totalPages - cur < 3 ? -3 + (c.totalPages - cur) : -1) : 0,
end = cur < 3 ? 5 - cur : 2;
for (i = start; i < end; i++) {
if (cur + i >= 1 && cur + i < c.totalPages) { t.push(cur + i); }
}
// make sure first and last page are included in the pagination
if ($.inArray(1, t) === -1) { t.push(1); }
if ($.inArray(c.totalPages, t) === -1) { t.push(c.totalPages); }
// sort the list
t = t.sort(function(a, b){ return a - b; });
// make links and spacers
$.each(t, function(j, v){
pages += '<a href="#" class="' + (v === cur ? 'current' : '') + '">' + v + '</a>';
pages += j < t.length - 1 && (t[j+1] - 1 !== v) ? ' ... ' : (j >= t.length - 1 ? '' : ' ');
});
$('.pagecount').html(pages);
})
.tablesorter({
widgets: ['zebra']
})
.tablesorterPager({
container: $(".pager"),
size: 3,
output: 'showing: {startRow} to {endRow} ({totalRows})',
removeRows: false
})
.tablesorterFilter({
filterContainer: "#filter",
filterColumns: [0,1,2,3]
});
для демонстрации плагина quicksearch .. какая версия tablesorter и какой paginator вы использовали? – JTester
Это демо всегда использует последнюю версию tablesorter & pager из моей вилки. – Mottie