我正在处理数据表,并在Chrome控制台中收到此错误未捕获的TypeError:无法读取未定义的属性'scrollHeight'
我还没有使用scrollHeight,但是错误与scrollHeight有关。我的Javascript已精简,所以我不知道哪一行引发了错误。
var table = $('#dataMatrixCustomTab').DataTable({
scrollY: "80vh",
scrollX: "100%",
bScrollCollapse: true,
bPaginate: false,
ordering: false,
fixedColumns: true,
destroy: true,
bAutoWidth: true,
autoWidth: true,
searching: false,
info: false,
iLeftWidth: 150,
scroller: true,
autoWidth: false,
bDeferRender: true,
responsive: true,
fixedColumns: {
leftColumns: 2
},
drawCallback: function (settings, start, end, max, total, pre) {
if ($('#dataMatrixCustomTab_wrapper .dataTables_scrollBody').hasScrollBar()) {
$('#dataMatrixCustomTab_wrapper .show-graph-bar').addClass("custom-graph-icon");
}
else {
$('#dataMatrixCustomTab_wrapper .show-graph-bar').removeClass("custom-graph-icon");
}
},
initComplete: function () {
$('.broker-toggle', '#dataMatrixCustomTab_wrapper').on('click', function (e) {
$("#fullviewBroker").empty();
$('.data-loading-wrapper').show();
$('.broker-modal').toggleClass('is-visible');
});
$('.stat-toggle', '#dataMatrixCustomTab_wrapper').on('click', function (e) {
$("#full_viewStatistics").empty();
$('.data-loading-wrapper').show();
$('.statistics-modal').toggleClass('is-visible');
});
}
});