JQuery-based paging instances for non-refreshing tables and jquery table paging instances
This example describes the implementation of jQuery-based Brushless new table
initial tr numberVar logo = 0;$ (Document). keydown (function (e ){Var table = $ ("table tr ");// If you press pagedownIf (e. keyCode = 40 ){// Remove all tr styles$ ("Tr. bak"). removeClass ("bak ");// Highlight the current tr$ ("Tr: eq (" + logo + ")"). addClass ("bak ");// Tr serial number plus 1Logo ++;}// If the tr serial number exceeds the tr length, the first row is returned;If (logo>
'). addclass (' active '); + A //Page Click event at$ (' #nav a '). bind (' click '),function(){ -$ (' #nav a '). Removeclass (' active ');//Remove all page numbers from the active class -$( This). addclass (' active ');//add an active class to the current page number - varcurrpage=$ ( This). attr (' rel ');//Remove the value on the page number - varStartitem=currpage*rowsshown;//the start of the number of lines = page number * lines displayed per page - varEndi
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
client, which will inevitably cause problems, in fact, this problem is not just a problem with this framework. All code that uses this method for paging has this problem, but this framework uses the WebService interface to communicate with the client, the importance of this problem is infinitely magnified.
We will discuss the paging processing in this framework as follows:
Environment: Visual studio 2005
This article illustrates the non-refresh table paging based on jquery implementation. Share to everyone for your reference, specific as follows:
The effect chart is as follows:
HTML structure:
CSS style:
html,body{margin:0;padding:0} a:focus {Outline:none}//* universal table display/
problem with this framework. All code that uses this method for paging has this problem, but this framework uses the WebService interface to communicate with the client, the importance of this problem is infinitely magnified.
We will discuss the paging processing in this framework as follows:
Environment: Visual Studio 2005
Jquery 1.3.2
Sqlserver2005
When the system data volume is very large, the front-end paging, asynchronous access is a better solution. All along, I want to use the jquery plugin I developed to do the system.Now, after learning the jquery plug-in development, and gradually also try to develop some simple plug-ins, has developed the accordion, tab, today and you introduce this DataTable page
This article illustrates the implementation of the table based on jquery without refreshing paging function, share for everyone to reference, the specific contents are as follows
Effect Chart:
Specific code:
html,body{margin:0;padding:0} a:focus {Outline:none} h3.head_title {border-bottom:1px solid #d5ddeb; color: #1c7493;d
isplay:block;font-size
exceeds the tr length, the first row is returned;If (logo> table. length ){Logo = 0;}// If pageup is pressedIf (e. keyCode = 38 ){// Tr serial number minus one in the current serial number, that is, moving up a positionVar l = logo-1;// If the tr serial number is smaller than 0, the tr serial number should be at the bottom;If (l L = table. length + l; // recalculate the tr serial number}$ ("Tr. bak"). remo
Recently I used a table page, searched the web for one, and then made some changes to my needs.
This example most of the reference to the Netizen ' incense fluttering 2011 ' Blog (blog Address: http://www.cnblogs.com/xiangpiaopiao2011/archive/2011/06/16/2083050.html), And in combination with their own needs made changes.
Using jquery to implement table dynamic
large number of data from the server to the client, will inevitably cause problems, In fact, this problem is not only the problem of this framework, all the code in this way to pagination in the case of the problem, but the framework of the WebService interface with the client communication, the problem is the importance of the infinite amplification.
Here we will discuss paging processing in this framework:
Environment: Visual Studio 2005
pointed TR
$ ("Tr:eq (" +logo+) "). AddClass (" bak ");
TR Serial number plus 1
logo++;
}
If the TR ordinal exceeds the length of TR, the first row is returned;
if (logo>table.length) {
logo=0;
}
If the pageup is pressed,
if (e.keycode==38) {
The TR ordinal is minus one in the current ordinal, which is to move up one position
var l=logo-1;
If the TR ordinal is less than 0, the TR number at this point should be at the bottom;
if (ll=table.length+l;//the TR serial number
}
$ ("Tr.
, default True
Switch, whether the client filtering feature is enabled
Binfo
True or FALSE, default True
switch, whether to display some information about the table
Bjqueryui
True or FALSE, default false
Whether to use the jquery UI Themeroller style
Blengthchange
True or FALSE, default True
switch, whether to display a selection b
Copy Code code as follows:
var countpage;
var nowpag = 1;
var pageSize;
var countsize;
var Starindex;
var endindex;
User Submission Information
var name;
var sex;
var age;
Define line number
var num = 1;
$ (document). Ready (function () {
Registering an event to add a user
$ ("#submit"). Click (function () {
Get information submitted by user
Name = $ ("#name"). Val ();
Sex = $ ("Input[name= ' Sex ']:checked"). Val ();
Age = $ ("#age"). Val ();
PageSize = $ ("#sel
Plug-in: https://github.com/luis-almeida/jPages
I have found many paging plug-ins on the Internet, but their usage is complicated, which is not conducive to the learning of new users. The following Code shows that it is convenient and concise to use. The biggest benefit of this plug-in is that no matter whether the table is statically generated or dynamically generated by the program, it can be paged and us
Source: Https://datatables.net/examples/index
1, the necessary files: DataTables js files and CSS files, download address: https://datatables.net/download/because it is dependent on jquery, you also need to download the jquery library.2, since the form of table display, then on the HTML page we need to first define a well-formed
Since Django Chinese is garbled in the foreground, this article uses the Django template to generate the table, and then uses the jquery grid to process the table.for displaying jquery grid tables{% for gift in gift_lists%} Django-Generated tables{% ENDFOR%}This article is from the "Python Django Jqurey" blog, so be sure to keep this source http://tomyu.blog.51ct
The specific code is as follows:
References to JS and CSS files are:
Copy Code code as follows:
Page code:
Copy Code code as follows:
Special attention here is to the table header plus The code for the background action is as follows:
Copy Code code as follows:
Public Actionforward Listuser (actionmapping mapping, Actionform form,
HttpServletRequest request, HttpServletResponse resp
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.