0

我在使用 tablesorter 时遇到了 2 个问题。

第一个是当我动态更改行数(使用复选框)时,tbody 中行的列宽会更改以适合第一个 thead 列宽。

第二个是,tablesortpager 在动态更改时不会刷新并仅加载 10 行。

任何帮助都会很棒。

这是链接:http ://www.greatgulf.com/houses2013/project/edgewood

4

1 回答 1

0

我猜你正在使用我看到的代码中的 tablesorter 分支。但是,我必须提前道歉,因为我仍在休假,互联网访问受限,无法提供更及时的支持。

我认为复选框(不在表格内)和寻呼机的主要问题是GG.resetTables功能的设置方式。我只能假设该函数旨在更新/刷新表。在这种情况下,尝试在该函数之外初始化 tablesorter resetTables,然后在该函数中触发更新。像这样的东西:

var $table = $("table")

    // Initialize tablesorter
    // ***********************
    .tablesorter({
        theme: 'blue',
        widthFixed: true,
        widgets: ['zebra']
    })

    // initialize the pager plugin
    // ****************************
    .tablesorterPager({
        // pager options here
    });


GG.resetTables = function () {
    $table.trigger('update');
};
于 2013-08-30T18:09:52.677 回答