kdy0831 2011. 3. 3. 11:11

- tablesorter : flexible client-side table sorting

- 특징

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 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


- tablesorter 사용하기 위한 js include
<script type="text/javascript" src="<%=Param.get("js.path")%>/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="<%=Param.get("js.path")%>/jquery.tablesorter.min.js"></script>

- 전체 테이블 정렬 true
$(document).ready(function(){
 $("#viewList").tablesorter();
 }
);   

-> table id = viewList 임.

- 특정 컬럼 정렬 false 하기.
$(document).ready(function() { 
    $("table").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 
            } 
        } 
    }); 
});

* table id 와 동일하지 않음.
- 관련 사이트
 1) http://tablesorter.com