2
我试图用的tablesorter和Tableedit如何在tablesorter和可编辑插件之间建立关系?我通过编辑插件更新数据
建立可编辑和排序表后,我需要更新的tablesorter这个数据,我不知道该怎么办呢
$('.example-2').Tabledit({
columns: {
identifier: [0, 'id'],
hideIdentifier: true,
editable: [[1, 'App Date'], [2, 'App Time'], [3, 'Service Type', '{"1": "@mdo", "2": "@fat", "3": "@twitter"}']],
}
});
$(function() {
$(".example-2").tablesorter({
headerTemplate: '{content}{icon}',
headers: {
0: {
sorter: false,
},
// assign the secound column (we start counting zero)
4: {
// disable it by setting the property sorter to false
sorter: false,
},
// assign the third column (we start counting zero)
5: {
// disable it by setting the property sorter to false
sorter: false
},
6: {
// disable it by setting the property sorter to false
sorter: false
},
7: {
// disable it by setting the property sorter to false
sorter: false
},
8: {
// disable it by setting the property sorter to false
sorter: false
},
}
});
$(".tabledit-save-button").click(function() {
var usersTable = $(".example-2");
usersTable.trigger("update")
.trigger("sorton", usersTable.get(0).config.sortList)
.trigger("appendCache")
.trigger("applyWidgets");
});
});
我试图在保存按钮被点击时更新数据,但它不起作用。