gpt4 book ai didi

javascript - Footable doSort 根本不起作用

转载 作者:行者123 更新时间:2023-11-28 19:12:00 26 4
gpt4 key购买 nike

我正在使用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'),这意味着我的表格没有问题。

检查footable代码,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;

最佳答案

当 footable 被调用两次时,就会发生这种情况。转载here in jsfiddle .

$('.footable').footable();

关于javascript - Footable doSort 根本不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30577076/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com