luis-almeida/jPages

why only show two pages

qy2016 opened this issue · 0 comments

<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

  <title>table</title>
  <link rel="stylesheet" href="css/jPages.css">

  <script type="text/javascript" src="js/jquery-1.8.2.min.js"></script>
  <script src="js/jPages.js"></script>

  <script type="text/javascript">
    $(function(){
        var vennum =1;
        var vnum = 0;
        var crtpages = 1;
        $("a.addVenn").bind("click",function(){
                    vnum++;
                    vennum++;
                    var indexV = $("#tableV tbody tr").length;
                    var indexVs = "Venn" + vennum;
                    var innerVh = "<tr><td class='cawid'<input type='checkbox' class='checkV'></td>";
                    innerVh += "<td>" + indexVs + "</td>";
                    innerVh += "<td><input type='text'/></td>";
                    innerVh += "</tr>";
                    $("#tableV tbody").append(innerVh);
                    if((indexV%2)==0){
                        crtpages += 1;
                        mypages(crtpages);
                    }
                });
    });
    var mypages = function (currentPages){
     $("div.holder").jPages({
      containerID : "abc",
      previous : "上一页",
      next : "下一页",
      perPage : 2,
      midRange:5,
      delay : 0,
      callback:function(pages, items){
        console.log("当前页面:" + pages.current);
        console.log("页面总数:" + pages.count);
        console.log("总数量:" + items.count);
      }
    });
     var page = parseInt( currentPages );
    $("div.holder").jPages( page );
};

  </script>
 </head>
 <body>
    <a href="javascript:void(0);" class="addVenn">添加</a>
    <table id="tableV">
                                        <thead>
                                            <tr>
                                                <th">
                                                    <label>
                                                        <input type="checkbox" name="vennCheckAll" id="checkAllV"/>
                                                    </label>
                                                </th>
                                                <th>title</th>
                                                <th>content</th>
                                            </tr>
                                        </thead>
                                        <tbody id="abc">
                                            <tr>
                                                <tdclass="cawid"><input type="checkbox" class='checkV'></td>
                                                <td>Venn1</td>
                                                <td>
                                                    <input type='text'/>
                                                </td>
                                            </tr>
                                        </tbody>
                                    </table>
                                    <div class="holder"></div>

</body>
Why run results show only two pages?