Use of front-end paging plug-in Bootstrappaginator

Source: Internet
Author: User

<Tableclass= "Table table-striped table-bordered table-hover dataTable no-footer"role= "Grid"Aria-describedby= "Sample_2_info">                        <thead>                            <TRrole= "Row">                                <thTabIndex= "0"Aria-label="">                                    **                                </th>                                <thTabIndex= "0"Aria-label="">                                    **                                </th>                                <thTabIndex= "0"Aria-label="">                                   **                                </th>                                <thTabIndex= "0"Aria-label="">                                    **                                </th>                                <thTabIndex= "0"Aria-label="">                                    **                                </th>                                <thTabIndex= "0"Aria-label="">                                    **                                </th>                                <thTabIndex= "0"Aria-label="">                                    **                                </th>                                <thTabIndex= "0"Aria-label="">                                    **                                </th>                            </TR>                        </thead>                        <tbodyID= "Tablebody"></tbody>                    </Table>                    <Divclass= "Paging-toolbar">                        <ulID= "Grid_paging_part"></ul>                    </Div>
<script>$(function() {Loadtables (1, 10);    }); functionloadtables (StartPage, pageSize) {$ ("#tableBody"). HTML (""); $.ajax ({type:"GET", URL:"/transaction/getrecordlist?startpage=" + startpage + "&pagesize=" +pageSize, Success:function(data) {$.each (data.rows,function(I, item) {varTR = "<tr>"; TR+ = "<td>" + Item.orderid + "</td>"; TR+ = "<td>" + item.appname + "</td>"; TR+ = "<td>" + item.realname + "</td>"; TR+ = "<td>" + item.accounttypename + "</td>"; TR+ = "<td>" + Item.transamount + "</td>"; TR+ = "<td>" + item.transTime.replace ("T", "") + "</td>"; if(Item.transtype = = ' 1 ') {TR+ = "<td>**</td>"; }                    if(Item.transtype = = ' 2 ') {TR+ = "<td>**</td>"; }                    if(Item.flag = = ' 0 ') {TR+ = "<td>**</td>"; }                    Else{TR+ = "<td>**</td>"; } TR+ = "</tr>"; $("#tableBody"). Append (tr); })                varElment = $ ("#grid_paging_part");//container ID of the paging plug-in                if(Data.rowcount > 0) {                    varOptions = {//Paging plug-in configuration itemsBootstrapmajorversion:3, Currentpage:startpage,//Current PageNumberOfPages:data.rowsCount,//TotalTotalPages:data.pageCount,//Total PagesShouldshowpage:function(Type, page, current) {varresult =!0; Switch(type) { Case"First": Result= 1!==Current ;  Break;  Case"Prev": Result= 1!==Current ;  Break;  Case"Next": Result= Current!== This. TotalPages;  Break;  Case"Last": Result= Current!== This. TotalPages;  Break;  Case"Page": Result=!0                            }                            returnresult}, Itemtexts:function(Type, page, current) {//sets the displayed style, which is the default arrow                            Switch(type) { Case"First":                                    returnHome;  Case"Prev":                                    return"Prev";  Case"Next":                                    return"Next Page";  Case"Last":                                    returnLast;  Case"Page":                                    returnpage; }}, Onpagechanged:function(Event, Oldpage, NewPage) {//Page Switch Eventsloadtables (NewPage, pageSize); }} elment.bootstrappaginator (options); //paging Plug-in initialization                }            }        })    };</script>

Use of front-end paging plug-in Bootstrappaginator

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.