layui table from page number is always "1" Solution

With Layui table page display data, a type: display number "numbers" has the following problems

1, the table comes with pagination, page: true

     This paging, a page number at the time of handover can be displayed properly increased, as follows:

   

    Display, the starting page number is not 1 second

   

2, page tab components

    This page, the page numbers when switching a kind of "1", that is, the serial number has been changed, as described below, the second page is the number "1" at the beginning

   

    In this case, the original code can be modified:

    Open layui.all.js, find g = a + s.limit * (n -1) +1; this followed by the following code var GGG s.limit * = A + ((n-CUR_PAGE ||) -1 ) + 1; , the current page is customized CUR_PAGE wherein,

    Found: Case "a Numbers": return g, the g into ggg; save and exit, the final display is as follows

   

    Another method, the type: numbers into a normal field display method, as follows: (wherein GLB_PAGE current page and custom tab page number of records)

   

    The results show the following:

   

   

Guess you like

Origin www.cnblogs.com/zbspace/p/11972738.html