如何更改数据表的语言?该代码有效,但是我想更改otable
的语言。基本上我的问题是,当我更改语言而不是otable.columns()时,evnt不起作用;当我使用var otable = $('#grdFormlist').DataTable();
时,更改语言不起作用
var otable = $('#grdFormlist').DataTable();
otable.columns().every(function () {
var that = this;
$('input', this.footer()).on('keyup change', function () {
if (that.search() !== this.value) {
that
.search(this.value)
.draw();
}
});
});
otable = $('#grdFormlist').DataTable({
"language": {
"url": "//cdn.datatables.net/plug-ins/9dcbecd42ad/i18n/French.json"
}
});
答案 0 :(得分:1)
感谢我的每一个问题都通过使用超时解决了。
var otable = $('#grdFormlist').DataTable({
"language": {
"url": "//cdn.datatables.net/plug-ins/9dcbecd42ad/i18n/French.json"
}
});
setTimeout(function () {
otable.columns().every(function () {
var that = this;
$('input', this.footer()).on('keyup change', function () {
if (that.search() !== this.value) {
that
.search(this.value)
.draw();
}
});
});
},3000)