在IE浏览器中,分页dataTable中的下一个按钮被禁用,但是当我单击下一个按钮时,将绘制dataTable。
在这种情况下如何防止绘制dataTable?
这是我的代码:
function initMatchingOrdersTable() {
var table = $('#matching-orders-table').DataTable( {
"columnDefs": [
{
"orderable": false,
"targets": [0, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]
},
{
"width": "2%",
"targets": 0
},
{
"width": "7%",
"targets": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]
}
],
"order": [[ 1, "asc" ]],
"aLengthMenu": [
[10, 25, 50, 100, 200, 500],
[10, 25, 50, 100, 200, 500]
],
"sDom": "tripl",
"bSort" : true,
"orderMulti": false,
"pagingType": "full_numbers",
"stateSave": false,
"processing": false,
"serverSide": true,
"ajax": {
"url": appName + '/invoice-details/get-matching-order-line',
"type": 'GET',
"data": function ( d ) {
d.invoiceId = $("#invoice-id").attr('value');
d.vendorId = $("#vendor").attr('vendor-id');
}
},
"columns": [
{ "data": "no", "className": "no-cls" },
{ "data": "orderNbr", "className": "orderNbr-cls" },
{ "data": "orderDate", "className": "orderDate-cls"},
{ "data": "upc", "className": "itemUPC-cls" },
{ "data": "description", "className": "description-cls" },
{ "data": "size", "className": "size-cls" },
{ "data": "vendorCost", "className": "vendorCost-cls" },
{ "data": "vendorQuantity", "className": "vendorQuantity-cls" },
{ "data": "vendorExtendedCost", "className": "vendorExtendedCost-cls" },
{ "data": "hebCost", "className": "hebCost-cls" },
{ "data": "hebQuantity", "className": "hebQuantity-cls" },
{ "data": "hebExtendedCost", "className": "hebExtendedCost-cls" },
{ "data": "finalCost", "className": "hebCost-cls" },
{ "data": "finalQuantity", "className": "hebQuantity-cls" },
{ "data": "finalExtendedCost", "className": "finalExtendedCost-cls" }
],
"oLanguage" : {
"sLengthMenu" : "Show _MENU_ rows",
"sInfoEmpty" : "No records to show",
"sInfo" : "Showing _START_ to _END_ of _TOTAL_ rows"
},
"rowCallback": function( row, data ) {
/* add class for cell */
$('td:eq(0)', row).addClass('text-right');
$('td:eq(1)', row).addClass('text-left');
$('td:eq(2)', row).addClass('text-center');
$('td:eq(3)', row).addClass('text-left');
$('td:eq(4)', row).addClass('text-left text-ellipsis');
$('td:eq(5)', row).addClass('text-left');
$('td:eq(6)', row).addClass('text-right');
$('td:eq(7)', row).addClass('text-right');
$('td:eq(8)', row).addClass('text-right');
$('td:eq(9)', row).addClass('text-right');
$('td:eq(10)', row).addClass('text-right');
$('td:eq(11)', row).addClass('text-right');
$('td:eq(12)', row).addClass('text-right');
$('td:eq(13)', row).addClass('text-right');
$('td:eq(14)', row).addClass('text-right');
$('td:eq(4)', row).attr( "title", data.description);
}
});
return table;
}
它适用于Chrome浏览器。