基于JQURY的sorttable插件

<script type="text/javascript" src="/path/to/jquery-latest.js"></script> 
<script type="text/javascript" src="/path/to/jquery.tablesorter.js"></script> 
 

今天在界面上开发时遇到要排序的table,虽然界面的GRID UI支持带参数的sort,但是这样不适合界面上有多个table的排序

只是只能通过JS来排序,在网上找到jquery tablesorter,呵呵发现他是个很好的JQURT PLUGIN

DOCS ADDRESS: http://tablesorter.com/docs/#Examples

一、简介

tablesorter is a jQuery plugin for turning a standard HTML table with THEAD and TBODY tags into a sortable table without page refreshes. tablesorter can successfully parse and sort many types of data including linked data in a cell. It has many useful features including:

  • Multi-column sorting
  • Parsers for sorting text, URIs, integers, currency, floats, IP addresses, dates (ISO, long and short formats), time. Add your own easily
  • Support for ROWSPAN and COLSPAN on TH elements
  • Support secondary "hidden" sorting (e.g., maintain alphabetical sort when sorting on other criteria)
  • Extensibility via widget system
  • Cross-browser: IE 6.0+, FF 2+, Safari 2.0+, Opera 9.0+
  • Small code size

二、使用方法

首先需要调用两个JS 文件


还有很参数配置,具体可以参考原文。

你可能感兴趣的:(JavaScript,jquery,Opera,IE,Safari)