我參加了一個領先形式這篇文章(jQuery table sort) - 在試圖做什麼Im做...jQuery的排序表
的代碼是在這裏。 http://jsfiddle.net/daqGC/
它不工作...任何想法
這裏的js代碼。 HTML可以在jsFiddle上找到。
var user_table = $('#users');
$('#company_header, #user_header, #email_header, #type_header')
.wrapInner('<span title="sort this column"/>')
.each(function(){
var th = $(this),
thIndex = th.index(),
inverse = false;
th.click(function(){
user_table.find('td').filter(function(){
return $(this).index() === thIndex;
}).sortElements(function(a, b){
return $.text([a]) > $.text([b]) ?
inverse ? -1 : 1
: inverse ? 1 : -1;
}, function(){
// parentNode is the element we want to move
return this.parentNode;
});
inverse = !inverse;
});
});
THx的
沒有firmiliar外部室內用林達,我只是鏈接到它jQuery的引用後?或者我下載它並將其粘貼到我的jquery文件中? – jpmyob 2013-02-19 09:30:12
是的,看我的編輯。 – Tsar 2013-02-19 11:27:00
THX - 現在開始工作 - 非常感謝 – jpmyob 2013-02-19 23:07:10