DataTables의 저장 스크롤 위치에 대해 몇 시간 동안 인터넷을 둘러 보았지만 운이 없었습니다. 적어도 내 경우에는 그렇지 않다. datatables에 따르면DataTables 상태 저장 위치 저장
, 나는이 코드 줄 필요 스크롤의 상태를 저장합니다 :
$(document).ready(function() {
var oTable = $('#example').dataTable({
"sScrollY": "200px",
"sAjaxSource": "media/data/2500.txt",
"sDom": "frtiS",
"bDeferRender": true,
"bStateSave": true
});
});
을하지만 나는 그것이 작동하지 않는 구문 분석 할 수있는 데이터와 텍스트 파일을 가지고 있지 않다 때문이다. PHP와 MYSQL을 사용하여 테이블의 배열을 가져 왔습니다.
"bStateSave": true
은 스크롤바를 제외하고 필터링 및 정렬과 같은 모든 사용자 입력을 저장합니다.
누구든지 해결 방법을 알고 있습니까?
편집 어떻게 든이 작업을 할 수있었습니다. 나는 진실에 대해 뭔가있는 것 같았습니다.
<!-- DATATABLES ENABLE INIT -->
<script>
<?php include ('js/datatables/ordernumhtml.js');?>
<?php include ('js/datatables/ordercurrency.js');?>
<?php include ('js/datatables/dataTables.scroller.min.js');?>
$(document).ready(function() {
$('#table1').dataTable({
"sDom": "frtiS",
"bDeferRender": false,
"bStateSave": true,
"bAutoWidth": true,
"bInfo": true,
"sScrollX": "100%",
"bScrollCollapse": true,
"bScrollAutoCss": true,
"bScrollInfinite": false,
"sScrollY": "350px",
"bJQueryUI": true,
"bProcessing": true,
"aoColumns": [
{ "sType": "num-html" },
{ "sType": "numeric" },
null,
null,
null,
null,
null,
null,
{ "sType": "currency" },
null,
{ "bSortable": false }
]
});
});
</script>