zoukankan      html  css  js  c++  java
  • 翻页中改变每页记录数后当前页面起始页问题

    Main Function:

        /**
         * Calculate the new page index when items per page changed
         * 
    @param currentPageIndex Current Page Index
         * 
    @param currentRowsPerPage Current Rows Per Page
         * 
    @param newRowsPerPage New Rows Per Page
         * 
    @return New page index.
         
    */
        
    private int newPageIndex(int currentPageIndex, int currentRowsPerPage, int newRowsPerPage)
        {
            
    int currentTopIndex = (currentPageIndex-1)*currentRowsPerPage+1;
            
    int newPageIndex = currentTopIndex%newRowsPerPage > 0 ? 
                    (currentTopIndex
    /newRowsPerPage)+1:
                    currentTopIndex
    /newRowsPerPage;
            
    return newPageIndex;
        }
  • 相关阅读:
    深度优先和广度优先
    ajax<转>
    display:inline-block后会有间隙
    css样式多了个分号
    回答
    return false作用
    824. Goat Latin
    7. Reverse Integer
    48. Rotate Image
    9. Palindrome Number
  • 原文地址:https://www.cnblogs.com/zenghanxi/p/1437967.html
Copyright © 2011-2022 走看看