Sometimes table column number is too long, not conducive to user query, so the use of JS made a table page, the following is the relevant codeOne, JS codeSecond, HTML code"Btn0">"pageSize"Type="text"Size="1"Maxlength="2"Value="Getdefaultvalue ()"/>"#"Id="Pagesizeset"> Settings "Sjzl">"#"Id="BTN1"> Home "#"Id="btn2"> Prev "#"Id="Btn3"> Next "#"Id="Btn4"> Last "Changepage"Type="text"Size="1"Maxlength="4"/>"#"
Premise: Customize the search and have paging capabilities, such as searching for product names.Phenomenon: When searching for inflatable dolls, return 100 records and turn to page fifth. At this time to search the massage stick, the data has 200, the results should be the first page of records, but the actual display is the result of the fifth page. That is, after re-searching, the pagenumber has not changed.According to most of the Internet: Re-set option on the line$ (' #tableList '). Bootstr
1. load data display and load images
2. Return JSON data and paging strings
3. Refreshing pagination
4. Reflection + generic --> simple general demo
Some people have questioned the reflection of brainstorming + generic construction of common functions.
5. Front-end
View code
Script Type = "Text/JavaScript" > $ ( Function () {Loaddata ();}); Function Loaddata (PARAM) {$. getjson ( " Ajax/userinfolist. ashx
Use JQuery to add and pagination table data on the page. For more information, see.
The Code is as follows:
Var countPage;Var nowPag = 1;Var pageSize;Var countSize;Var starIndex;Var endIndex;// Information submitted by the userVar name;Var sex;Var age;// Define the row numberVar num = 1;$ (Document). ready (function (){// Register an event for adding a user$ ("# Submit"). click (function (){// Obtain inf
Stitching table Please run the following code directly: replace
Bootstrap.css jquery-1.12.3.min.js Bootstrap-paginator.min.js "
Results
Attention
1,BOOTSTRAP3 page ID for #example must be UL tag, 2, in JS option in Bootstrapmajorversion:3
1,BOOTSTRAP2 page ID #example must be div tag, 2, in JS option Bootstrapmajorversion:2
The paging source code explains:
Extension instructions
Above I was stitching the form, you can splice into
Angularjs from the beginning of the release to the current use of the development of more and more, also shows that most of the front end of the friend to turn this way, after all, is the product of Google products Ah, so recently I also learn this part of knowledge.
Angularjs Bootstrap Implementation form pagination:
Recently has been learning angular.js, in the learning process also practiced a lot of demo, here first paste the
Page General and table together, pagination link as part of the table, the paging link encapsulated into a separate component, and then as a child component embedded in the table component, this is more reasonable.
Effect:
Code:
1. Register a component
Js
Vue.component ('
Page General and table together, pagination link as part of the table, the paging link encapsulated into a separate component, and then as a child component embedded in the table component, this is more reasonable.
Effect:
Code:
1. Register a component
Js
Vue.component ('
This article describes the MySQL learning Notes data definition table constraints, pagination method. Share to everyone for your reference, specific as follows:
1. Primary KEY Primary
Feature: A primary key is a constraint that uniquely identifies a record, a table can have at most one primary key, cannot be empty, and cannot be duplicated
CREATE
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.