2017-04-03 23 views
0

當我在當前頁面上垂直滾動下拉頁面時,其他頁面已正確加載。
但是當我有點向下滾動後更改頁面,則數據表被錯位
雖然如果我搜索的東西這個錯位的dataTable得到一致的,但我不希望數據表中得到錯位首先在頁面的變化Datatable越來越未對齊,當向下滾動一點後更改頁面時

這是我的配置 dTable = $("table.list").dataTable({ "iDisplayLength": 100, "fixedHeader":true, "sScrollX": "100%", "sScrollY": "440px", "aaSorting": [[3,'asc']], "columns": [ null,null,null,null,null, { "orderDataType": "dom-text-numeric" }, { "orderDataType": "dom-text", type: 'string' },{ "orderDataType": "dom-text", type: 'string' }, { "orderDataType": "dom-select" },{ "orderDataType": "dom-text", type: 'string' }, { "orderDataType": "dom-text", type: 'string' },{ "orderDataType": "dom-text", type: 'string' }, { "orderDataType": "dom-text", type: 'string' },{ "orderDataType": "dom-text", type: 'string' }, { "orderDataType": "dom-text", type: 'string' },{ "orderDataType": "dom-text", type: 'string' } ], "columnDefs": [ { "type": "num-html", targets: 4 }, { "type": "num-html", targets: 5 } ], "fixedColumns":{ leftColumns: 4 }, "autoWidth":true, 'responsive':true });

回答

0

我做了錯誤的不是原因,但解決方案或破解這有助於我是 dTable.on("page.dt",handlePageChange); function handlePageChange(){ document.querySelector(".dataTables_scroll div.dataTables_scrollBody").scrollTop=0; }

說明:
1.此功能將被稱爲BE在更改數據表中的頁面,並點擊分頁按鈕
2.在更改頁面之前,使dataTable body的scrollTop = 0;

相關問題