Я использую footable версии 2.0.3.
Когда я пытаюсь отсортировать вручную с помощью...
$('.footable').data('footable-sort').doSort(4, true)
... Я получаю следующую ошибку:
Uncaught TypeError: Cannot read property 'sort' of undefined
at Sort.p.doSort (http://localhost:8080/js/footable.sort.js:125:23)
Это очень странно. Например, фильтр работает $('.footable').data('footable-filter').filter('some text')
, значит с моей таблицей проблем нет.
Проверяя нижний колонтитул, ft.columns
пусто, поэтому column
не определено.
var $table = $(ft.table),
$tbody = $table.find('> tbody'),
column = ft.columns[columnIndex],
$th = $table.find('> thead > tr:last-child > th:eq(' + columnIndex + ')'),
cls = ft.options.classes.sort,
evt = ft.options.events.sort;