jQuery tablesorter 插件使用
2012-09-21 09:30
274 查看
/**
Start by telling tablesorter to sort your table when the document is loaded:
*/
$(document).ready(function(){
$("#myTable").tablesorter();
});
/**
排序列表 [0,0][1,0] 按第一列,第二列进行升序排序 [列索引,排序方向] 0 asc 1 desc
Click on the headers and you'll see that your table is now sortable! You can also pass in configuration options when you initialize the table. This tells tablesorter to sort on the first and second column in ascending order.
*/
$(document).ready(function(){
$("#myTable").tablesorter( {sortList: [[0,0], [1,0]]} );
});
/**
排序选项设置
*/
$(document).ready(function(){
$("#myTable").tablesorter({widthFixed: true, widgets: ['zebra']});
});
/*
var myTextExtraction = function(node){
// extract data from markup and return it
return node.childNodes[0].childNodes[0].innerHTML;
}
$(document).ready(function(){
$("#myTable").tableSorter({textExtraction: myTextExtraction});
});
*/
/**
禁止第二列.每三列进行排序
**/
$(document).ready(function(){
$("myTable").tablesorter({
// pass the headers argument and assing a object
headers: {
// assign the secound column (we start counting zero)
1: {
// disable it by setting the property sorter to false
sorter: false},
// assign the third column (we start counting zero)
2: {
// disable it by setting the property sorter to false
sorter: false}
}
});
});
/**
使用TH更像一个按钮
$(document).ready(function(){
$("#myTable").tableSorter(
{cancelSelection:true}
);
});
*/
/**
强制某列排序后不能动,其它列根据该列进行排序
Sort multiple columns simultaneously by holding down the shift key and clicking a second, third or even fourth column header!
*/
$(document).ready(function(){
// call the tablesorter plugin/
$("myTable").tablesorter({
// set forced sort on the fourth column and i decending order.
sortForce: [[0,0]]}
);
});
/**
按键的更换
*/
$(document).ready(function(){
// call the tablesorter plugin
$("table").tablesorter({
// change the multi sort key from the default shift to alt button
sortMultiSortKey: 'altKey'
});
});
/**
$(document).ready(function(){
$("table").tablesorter();
$("#ajax-append").click(function() {
$.get("assets/ajax-content.html",function(html) {
// append the "ajax'd" data to the table body
$("table tbody").append(html);
// let the plugin know that we made a update
$("table").trigger("update");
// set sorting column and direction, this will sort on the first and third column
var sorting = [[2,1],[0,0]];
// sort on the first column
$("table").trigger("sorton",[sorting]);
});
return false;
});
});
**/
$(document).ready(function(){
$("myTable").tablesorter({widthFixed: true, widgets: ['zebra']})
.tablesorterPager({container: $("#pager")});
});
Start by telling tablesorter to sort your table when the document is loaded:
*/
$(document).ready(function(){
$("#myTable").tablesorter();
});
/**
排序列表 [0,0][1,0] 按第一列,第二列进行升序排序 [列索引,排序方向] 0 asc 1 desc
Click on the headers and you'll see that your table is now sortable! You can also pass in configuration options when you initialize the table. This tells tablesorter to sort on the first and second column in ascending order.
*/
$(document).ready(function(){
$("#myTable").tablesorter( {sortList: [[0,0], [1,0]]} );
});
/**
排序选项设置
*/
$(document).ready(function(){
$("#myTable").tablesorter({widthFixed: true, widgets: ['zebra']});
});
/*
var myTextExtraction = function(node){
// extract data from markup and return it
return node.childNodes[0].childNodes[0].innerHTML;
}
$(document).ready(function(){
$("#myTable").tableSorter({textExtraction: myTextExtraction});
});
*/
/**
禁止第二列.每三列进行排序
**/
$(document).ready(function(){
$("myTable").tablesorter({
// pass the headers argument and assing a object
headers: {
// assign the secound column (we start counting zero)
1: {
// disable it by setting the property sorter to false
sorter: false},
// assign the third column (we start counting zero)
2: {
// disable it by setting the property sorter to false
sorter: false}
}
});
});
/**
使用TH更像一个按钮
$(document).ready(function(){
$("#myTable").tableSorter(
{cancelSelection:true}
);
});
*/
/**
强制某列排序后不能动,其它列根据该列进行排序
Sort multiple columns simultaneously by holding down the shift key and clicking a second, third or even fourth column header!
*/
$(document).ready(function(){
// call the tablesorter plugin/
$("myTable").tablesorter({
// set forced sort on the fourth column and i decending order.
sortForce: [[0,0]]}
);
});
/**
按键的更换
*/
$(document).ready(function(){
// call the tablesorter plugin
$("table").tablesorter({
// change the multi sort key from the default shift to alt button
sortMultiSortKey: 'altKey'
});
});
/**
$(document).ready(function(){
$("table").tablesorter();
$("#ajax-append").click(function() {
$.get("assets/ajax-content.html",function(html) {
// append the "ajax'd" data to the table body
$("table tbody").append(html);
// let the plugin know that we made a update
$("table").trigger("update");
// set sorting column and direction, this will sort on the first and third column
var sorting = [[2,1],[0,0]];
// sort on the first column
$("table").trigger("sorton",[sorting]);
});
return false;
});
});
**/
$(document).ready(function(){
$("myTable").tablesorter({widthFixed: true, widgets: ['zebra']})
.tablesorterPager({container: $("#pager")});
});
相关文章推荐
- jQuery tablesorter 插件使用
- jQuery入门教程-使用tablesorter插件(表格排序)
- jquery tablesorter插件的使用
- jQuery 表格排序插件 Tablesorter 使用
- 使用jquery的tablesorter插件进行表格排序
- jQuery 表格排序插件 Tablesorter 使用
- jQuery tablesorter 插件使用
- 使用jquery的tablesorter插件进行表格排序
- jquery.tablesorter表格排序插件的使用 收藏
- 使用jquery的tablesorter插件进行表格排序
- jQuery 表格排序插件 Tablesorter 使用
- jQuery tablesorter 插件使用
- 使用jQuery 插件 tablesorter 的基本使用
- 使用jQuery 插件 tablesorter 的基本使用
- 表格排序——jQuery插件tablesorter的使用
- jQuery 表格排序插件 Tablesorter 使用
- jquery tablesorter表格排序插件的使用
- 使用用jQuery和QuickSearch、TableSorter插件来增强界面交互
- jQuery 表格排序插件 Tablesorter 使用
- jQuery排序插件tableSorter使用方法