我必须自定义jquery数据表以更改长度菜单选项以及行为。 在length选项中,我需要将某些文本指定为“ Initiated,” dispatched“,” received“,基于这些状态,我需要过滤具有分别与” Initiated,“ dispatched”,“ received”匹配的状态列的行。
我该怎么做?任何指针都会有所帮助。
答案 0 :(得分:1)
Jquery数据表的大多数属性都在下面的代码中应用,因为您没有找到适当的更改选项,因此可以尝试使用这些属性。
$('#dtId').DataTable({
"ajax": {
"url": "/search/LoadData",
"type": "GET",
"datatype": "json"
},
"info": true,
"responsive": true,
"paging": true,
"pageLength": 10,
"ordering": true,
"dom": 'T<"clear">lfrtip',
"pagingType": "full_numbers",
"language": {
"lengthMenu": "Display _MENU_ Per Page",
"info": "Displaying _START_ - _END_ of _TOTAL_",
"paginate": {
"first": '<i class="fa fa-angle-double-left" ></i> First',
"previous": '<i class="fa fa-angle-double-left" ></i> Previous',
"next": 'Next <i class="fa fa-angle-double-right" ></i>',
"last": 'Last <i class="fa fa-angle-double-right" ></i>'
},
},
"dom": "<'row'<'col-sm-4'i><'col-sm-4'p><'col-sm-4'l>>" + "<'row'<'col-sm-12'tr>>",
"scrollX": true,
"lengthMenu": [
[5, 10, 15, 20, -1],
[5, 10, 15, 20, "All"] // change per page values here
],
"buttons": [
'csv', 'excel', 'pdf'
]
});