我有一个html表,并且在单击一行时,另一个表将动态填充,并且应该具有固定的标头,并且默认情况下将选择父表的第一行,并且子表列标题将自动调整大小并且它正常工作很好,当单击父表中的任何行时,固定标题正在工作。
$(document).on('click', '#hrztable tbody tr', function (event) {
var table = $('#sortTable').DataTable();
table.destroy();
$("#sortTable").dataTable({
"sScrollY": "100px",
"bScrollCollapse": true,
"bFilter": false,
"bAutoWidth": false
});
width = $(window).width();
height = $(window).height();
$(window).trigger('resize');
});
var resizeTimer;
$(window).on('resize', function (e) {
//debugger;
alert('test');
clearTimeout(resizeTimer);
resizeTimer = setTimeout(function () {
var sortTable = $('#sortTable').dataTable();
sortTable.fnAdjustColumnSizing(false);
}, 1000);
});