它无法处理页面加载。但是点击按钮就可以了。
给予溶液
$(document).ready(function () {
$("ul#phaseTab li:first-child a").trigger('click');
$('#phaseTab').on('click','li', function () {
if (tabIndex != $(this).index()&&rowdata!=null)
{
restoreRow(phaseTable, rowdata, nEditing);``
}
tabIndex = $(this).index();
for (var i = 6; i <= columnCount-2; i++) {
if (i >= 6 + tabIndex * 5 && i < 6 + (tabIndex + 1) * 5) {
phaseTable.columns(i).visible(true);
}
else {
phaseTable.columns(i).visible(false);
}
}
});
});
答案 0 :(得分:0)
错误的点击元素或错误的eventListener。
您在页面加载时单击锚点。但是你的事件监听器是在li元素上。