Cam*_*mmy 0 javascript jquery tablesorter
Tablesorter不是以某种方式接受.addParser.我收到错误"undefined is not a function".这是我的代码:
$('mytable').tablesorter({
sortList: [[0,0]],
sortRestart: true,
initialized: function(table) {
var currentTable = $(table);
var startcol = currentTable.data("startcol");
if (startcol) {
var sorting = [[startcol, 0]];
currentTable.trigger("sorton", [sorting]);
}
},
headers:
{
4: { sorter: 'customparse' },
5: { sorter: 'customparse' }
}
}).addParser({
id: 'customparse',
is: function (s) {
return false;
},
format: function (s) {
console.log(s);
return s.replace(/\s+/g, '').replace(/,/g, '.');
},
type: 'numeric'
});
Run Code Online (Sandbox Code Playgroud)
我发现了一些其他相关的问题,无法找到我的问题..我很怀疑jQuery不包含两次.它没有addPareser工作正常甚至认为我使用的jQuery版本是1.11.但我尝试更新到2.1版但没有变化..
我发错了吗?我究竟做错了什么..
| 归档时间: |
|
| 查看次数: |
342 次 |
| 最近记录: |