Нумерация таблиц не обновляется, если я изменю таблицу из внешнего скрипта

У меня есть следующая конфигурация TableSorter:

$(function(){
            $table = $('#table')
                    .tablesorter({
                        theme: 'blue',
                        widthFixed: true,
                        headerTemplate: '{content} {icon}',
                        widgets: ['zebra','filter'],
                        widgetOptions: {
                            zebra: ["even", "odd"],
                            // filter_anyMatch replaced! Instead use the filter_external option
                            // Set to use a jQuery selector (or jQuery object) pointing to the
                            // external filter (column specific or any match)
                            filter_external : '.search',
                            // add a default type search to the first name column
                            filter_defaultFilter: { 1 : '~{query}' },
                            // include column filters
                            filter_columnFilters: true,
                            filter_placeholder: { search : 'Искать...' },
                            filter_saveFilters : true,
                            filter_reset: '.reset'
                        }
                    })
                // needed for pager plugin to know when to calculate filtered rows/pages
                    .addClass('hasFilters')
                    .tablesorterPager({
                        container: $(".table-pager"),
                        output: '{page} of {filteredPages} ({filteredRows})',
                        size: 5
                    });
        });

Это выглядит так:

У меня есть внешний JavaScript, который меняет дерево таблицы DOM. Но нумерация страниц не обновляется. Как я могу добиться обновления пагинации?

1 ответ

Попробуйте вызвать следующее (после того, как таблица была изменена):

$("#table").trigger("update");
Другие вопросы по тегам