2016-08-04 1 views
1

20 개 열 (62MB)이있는 테이블 내에 200,000 개가 넘는 결과가 있습니다. 나는 그들을 HTML 테이블에 보여주고 싶다. DataTables로 해봤지만로드하는 데 시간이 오래 걸립니다. 내 응용 프로그램이 호출 Phalcon/PHP로 수행됩니다큰 MYSQL 결과를 검색/페이지 매김이있는 테이블에 표시하는 가장 좋은 방법은 무엇입니까?

$catalog = Catalog::find(); 

<table id="example" class="display" cellspacing="0" width="100%"> 
    <thead> 
     <tr> 
      <th>Name</th> 
      <th>Position</th> 
      <th>Office</th> 
      <th>Age</th> 
      <th>Start date</th> 
      <th>Salary</th> 
     </tr> 
    </thead> 
    <tfoot> 
     {% for item in catalog %} 
     <tr class="odd">      
      <td class="pointer hidden-xs hidden-sm">{{ item.description }}</td> 
      <td class="pointer hidden-xs hidden-sm">{{ item.description2 }}</td> 
      <td class="pointer hidden-xs hidden-sm">{{ item.description3 }}</td> 
      <td class="pointer hidden-xs hidden-sm">{{ item.description4 }}</td> 
      <td class="pointer hidden-xs hidden-sm">{{ item.description5 }}</td> 
     </tr> 
     {% endfor %} 
    </tfoot> 
</table> 

표는 단지 ​​예를하지 20 COLS와 실제 하나입니다. 문제는 모든 데이터를 테이블이나 특정 솔루션에로드하는 것을 피하기 위해 플러그인을 사용하는 것이 좋습니다? 데이터 테이블과 같은 열을 검색 할 수 있어야합니다.

+1

제한을 사용하여 백엔드에서 쿼리를 사용하여 맞춤 datatable을 사용해보세요. –

+0

DataTables를 계속 사용하지 않고 Ajax 메서드를 사용하는 것이 좋습니다. 문서 : https://datatables.net/manual/ajax#Loading-data –

+0

다음을 살펴 보았습니다. https://datatables.net/examples/data_sources/server_side.html 하지만 ssp.class.php가 많이 필요합니다. – Sergio

답변

0

나는 마침내 datatables 서버 측에서 위대한 결과를 얻었다. 모두의 사람