2014-06-18 3 views
1

내 프로젝트에서 FooTable-2을 구현하려고하지만 어떤 이유로 인해 페이지 매김을 사용할 수 없습니다.왜 footable의 페이지 매김이 작동하지 않습니까?

<div id="mainContent"> 
    <div id="allTrackersDiv" style="display: none;"> 
     <label><b>Active Trackers</b></label> 
     <table class="activeTrackersTable" id="allTrackersTable" 
     data-page-navigation=".pagination"> 
     <thead> 
      <tr> 
       <th> ID </th> 
       <th> col 1 </th> 
       <th> col 2 </th> 
       <th> col 3 </th> 
      </tr> 
     </thead> 
     <tbody data-bind="foreach: trackersObjArray"> 
      <tr data-bind="click: test"> 
       <td><span data-bind="text: tId"></span></td> 
       <td><span data-bind="text: tname"></span></td> 
       <td><span data-bind="text: pname"></span></td> 
       <td><span data-bind="text: tcreate"></span></td> 
      </tr> 
     </tbody> 
     <tfoot> 
      <tr> 
       <td colspan="4"> 
        <div class="pagination"></div> 
       </td> 
      </tr> 
     </tfoot> 
     </table> 
    </div> 
</div> 

문제는 페이징이 작동하지 않는 것입니다 : 여기 THIS 자습서를 다음과있어

는 지금까지 테이블 코드로있는 것입니다. 내 테이블 (22 개) 기록을 가지고 있고 10 기록

다음

어떻게 보이는지 후 페이징을 시작하도록되어 :

Cropped image

내가 여기서 무엇을 놓치고? 내 관점에서는 모든 것이 꽤 괜찮아 보입니다. 나는 무엇을 놓치고 있는지, 나는 나의 실수를 정말로 이해할 수 없다.

+3

당신은 너무 자바 스크립트를 게시해야합니다. 그리고 바이올린도 도움이 될 것입니다. – j08691

+1

헤드 라인 "페이징이 작동하지 않는 이유는 무엇입니까?" 문제를 설명하지 않습니다. 게시 할 때마다 몇 마디로 문제를 설명하도록하십시오. 그냥 말하십시오. – entiendoNull

+0

'data-page-size = "10"'을 명시 적으로 추가 했습니까? 불이행에 문제가있는 경우? –

답변

3

명시 적으로

data-page-size="10" 

언급 시도 할 수 있습니다.

그리고 작동하지 않는 경우 동적 데이터가 footable에 추가되어 문제가 될 수 있습니다.

사용

$('#myTable').append(html).trigger('footable_redraw'); 

그래서 footable이 redrawed되고 크기 제한이 적용됩니다.

참조 링크 : Footable data page size not respectedOther issues due to dynamic data in footable

+0

append (html)가 작동하지 않으면 try (this.html) 코드가 다음과 같을 것입니다 : $ ('# myTable'). append (this.html) .trigger ('footable_redraw'); –