0
내 응용 프로그램에서 창과 오른쪽 창을 벗어났습니다. 오른쪽 창에는 여러 탭이 있으며 각 탭에는 데이터 테이블이 있습니다.fnAdjustColumnSizing을 사용할 때 DataTable의 크기가 조정되지 않습니다.
사용자가 오른쪽 창만 보려는 경우 오른쪽 창을 확장 할 수있는 기능을 제공하므로 오른쪽 창을 확장 할 때마다 데이터 테이블을 확장해야합니다.
현재 데이터 테이블을 확장/축소하는 데 아래 코드를 사용하고 있지만 제대로 작동하지 않습니다. 하나의 데이터 테이블 (화면에 표시된 현재 테이블) 만 제대로 크기가 조정되고 다른 테이블의 크기가 제대로 조정되지 않습니다.
누군가이 문제와 관련하여 도움을 줄 수 있습니까?
function onCollapse(e) {
var table = $.fn.dataTable.fnTables(true);
if (table.length > 0) {
setTimeout(function() {
for(var i=0;i<table.length;i++){
$(table[i]).dataTable().fnAdjustColumnSizing();
}
}, 200);
}
}
function onExpand(e) {
var table = $.fn.dataTable.fnTables(true);
if (table.length > 0) {
setTimeout(function() {
for(var i=0;i<table.length;i++){
$(table[i]).dataTable().fnAdjustColumnSizing();
}
}, 200);
}
}
감사합니다, Barani
http://datatables.net/release-datatables/examples/api/tabs_and_scrolling.html –