Re: [ js ] jQuery的表格排序
※ 引述《arianda (火鍋)》之銘言:
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 60.250.32.15
→
12/05 16:26,
12/05 16:26
→
12/05 16:32,
12/05 16:32
→
12/05 16:48,
12/05 16:48
謝謝提醒我有Parser可以用, 改成下面的就正常了
$.tablesorter.addParser({
// set a unique id
id: 'numberic',
is: function(s) {
// return false so this parser is not auto detected
return false;
},
format: function(s) {
// format your data for normalization
// 回傳為數值
return parseInt(s)
},
// set type, either numeric or text
type: 'numeric'
});
$(document).ready(function(){
$("#myTable").tablesorter({
headers: {
7: {sorter:'numberic'}, //7,6欄位都使用這Parser
6: {sorter:'numberic'} //保險是全部數值欄位都要設定
}
});
} );
--
海綿寶寶, 不要講話!派大星!
我覺得有人在盯著我們看... 你會害我們被發現!
★ ▉
JUNU
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 60.250.32.15
討論串 (同標題文章)
完整討論串 (本文為第 2 之 2 篇):
Ajax 近期熱門文章
PTT數位生活區 即時熱門文章