修復(fù)jQuery tablesorter無法正確排序的bug(加千分位數(shù)字后)
更新時間:2016年03月30日 11:18:28 投稿:mrr
這篇文章主要介紹了如何修復(fù)jQuery tablesorter無法正確排序的bug(加千分位數(shù)字后)的相關(guān)資料,需要的朋友可以參考下
找到函數(shù):
function getElementText(config, node) {
var text = "";
if (!node) return "";
if (!config.supportsTextContent) config.supportsTextContent = node.textContent || false;
if (config.textExtraction == "simple") {
if (config.supportsTextContent) {
text = node.textContent;
} else {
if (node.childNodes[0] && node.childNodes[0].hasChildNodes()) {
text = node.childNodes[0].innerHTML;
} else {
text = node.innerHTML;
}
}
} else {
if (typeof(config.textExtraction) == "function") {
text = config.textExtraction(node);
} else {
text = $(node).text();
}
}
return text;
}
把上邊的function改成下邊的即可:
function getElementText(config, node) {
var text = "";
if (!node) return "";
if (!config.supportsTextContent) config.supportsTextContent = node.textContent || false;
if (config.textExtraction == "simple") {
if (config.supportsTextContent) {
text = node.textContent;
} else {
if (node.childNodes[0] && node.childNodes[0].hasChildNodes()) {
text = node.childNodes[0].innerHTML;
} else {
text = node.innerHTML;
}
}
} else {
if (typeof(config.textExtraction) == "function") {
text = config.textExtraction(node);
} else {
text = $(node).text();
}
}
return (text.replace(/,/g,''));
}
以上內(nèi)容是小編給大家介紹的修復(fù)jQuery tablesorter無法正確排序的bug,希望對大家有所幫助!
相關(guān)文章
jQuery實(shí)現(xiàn)的點(diǎn)擊按鈕改變樣式功能示例
這篇文章主要介紹了jQuery實(shí)現(xiàn)的點(diǎn)擊按鈕改變樣式功能,涉及jQuery基于事件響應(yīng)的頁面元素樣式動態(tài)操作相關(guān)實(shí)現(xiàn)技巧,需要的朋友可以參考下2018-07-07
jquery對所有input type=text的控件賦值實(shí)現(xiàn)方法
下面小編就為大家?guī)硪黄猨query對所有input type=text的控件賦值實(shí)現(xiàn)方法。小編覺的挺不錯的,現(xiàn)在就分享給大家,也給大家做個參考。一起跟隨小編過來看看吧2016-12-12
jquery中的ajax方法怎樣通過JSONP進(jìn)行遠(yuǎn)程調(diào)用
這篇文章主要介紹了jquery中的ajax方法怎樣通過JSONP進(jìn)行遠(yuǎn)程調(diào)用,需要的朋友可以參考下2014-05-05
jquery 利用show和hidden實(shí)現(xiàn)級聯(lián)菜單示例代碼
級聯(lián)菜單的實(shí)現(xiàn)方法有很多,在本文為大家介紹下使用show和hidden輕松實(shí)現(xiàn)下級聯(lián)效果,感興趣的朋友可以參考下,希望對大家有所幫助2013-08-08
學(xué)習(xí)jQuery中的noConflict()用法
在本篇文章中我們整理了關(guān)于學(xué)習(xí)jQuery中的noConflict()用法的相關(guān)知識點(diǎn)內(nèi)容,有需要的朋友們可以學(xué)習(xí)下。2018-09-09
jQuery實(shí)現(xiàn)鼠標(biāo)移到某個對象時彈出顯示層功能
這篇文章主要介紹了jQuery實(shí)現(xiàn)鼠標(biāo)移到某個對象時彈出顯示層功能,涉及jQuery基于事件響應(yīng)動態(tài)操作頁面元素屬性相關(guān)實(shí)現(xiàn)技巧,需要的朋友可以參考下2018-08-08

