2017-02-22 7 views
1

웹 기반 프로젝트에서 jquery jTable을 사용하고 있습니다. 그것의 페이지 매김은 행의 수가 10,000보다 작을 때 잘 동작합니다. 그러나 행 수가 에서 10000을 초과하면 페이지 매김에 익숙하지 않은 문제가 발생합니다. 페이지 번호 매기기는 홀수 페이지 번호 매기기를 건너 뛰기 시작합니다. enter image description herejQuery jTable 페이지 매김이 제대로 작동하지 않습니다.

jTable에 대한 나의 javaScript 코드는 다음과 같습니다 : jTablehtml 태그

$("#AllProductTable").jtable({ 
      paging: true, 
      pageSize: 10, 
      columnSelectable: false, 
      actions: { 
       listAction: '/ProductDefinition/Select' 
      }, 
      fields: { 
       ProductId: { visibility: 'hidden', listClass: 'right-align' }, 
       ProductCode: { title: 'Product Code' }, 
       // more fields... 
      }, 
      recordsLoaded: function (event, data) { 

      } 
     }); 

입니다

동안 : 당신은 아래 그림에서 볼 수
<div id="AllProductTable" style="width:400%;"></div> 

내가 많이 \을 탐구하지만, didn를 그와 관련된 솔루션을 찾지 못했습니다. 나는이 미스 행동을 더 이상 이해할 수 없다.

답변

0

마지막으로 나는이 문제를 해결하는 데 성공했습니다. 나는 jquery.jtable.js 전체 파일을 살펴보고 이상한 것을 찾아 낸다. function. 이 함수는;

_refreshGotoPageInput: function() { 
    // different logic statements 
    //... 

    //Skip some pages is there are too many pages 
    var pageStep = 1; 
    if (currentPageCount > 10000) {  // if you having more than 10,000 pages 
     pageStep = 100; 
    } else if (currentPageCount > 5000) { // if you having more than 5000 pages 
     pageStep = 10; 
    } else if (currentPageCount > 2000) { // if you having more than 2000 pages 
     pageStep = 5; 
    } else if (currentPageCount > 1000) { // if you having more than 1000 pages 
     pageStep = 2; 
    } 

    //.... 
    // Differnet logic statements 
} 

단지 comment에 위의이 부분은 자신의 구현 로직에 따라 function을 부여하거나 수정 모두 당신이 필요합니다. 그 페이지 변경에 2 단계를 복용 왜 내 위에서 언급 한 경우

no_of_pages 1000에서 증가했다, 그건.