Tôi muốn thay đổi tiêu đề của một cột DataTable của tôi được tạo ra bởi jQuery Plugin DataTableTự động thay đổi tiêu đề cột của plugin dataTable jQuery như thế nào?
Bạn có biết nếu tôi có thể làm điều gì đó như thế này:
table = $('#example').DataTable({
"data": source_dataTable,
"columnDefs": defs,
"dom": 't<"top"f>rt<"bottom"lpi><"clear">',
});
// WHAT I WANT TO DO:
table.column(0).title.text("new title for the column 0")
?
Nó ám một html một dòng đầu tiên như thế:
<table id="example" class="row-border hover dataTable no-footer" role="grid" aria-describedby="example_info" style="width: 1140px;">
<thead>
<tr role="row">
<th class="sorting" tabindex="0" aria-controls="example" rowspan="1" colspan="1" aria-label="S&#233;lectionn&#233;: activer pour trier la colonne par ordre croissant" style="width: 94px;">Sélectionné</th>
<th class="sorting" tabindex="0" aria-controls="example" rowspan="1" colspan="1" aria-label="Anglais : activer pour
trier la colonne par ordre croissant" style="width:
62px;">Anglais </th>
</tr>
</thead>
</table>
...
Trong một bảng bình thường mã công việc dưới đây, nhưng đối với DataTable trả lại bởi jQuery plugin, nó không:
$('#example tr:eq(0) th:eq(0)').text("Text update by code");
Có thể có phương pháp API hoặc cách thức khác?
ví dụ nên bằng tiếng Anh, n ot trong tiếng Pháp –