修復jQuery tablesorter無法正確排序的bug(加千分位數(shù)字后)
更新時間:2016年03月30日 11:18:28 投稿:mrr
這篇文章主要介紹了如何修復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)容是小編給大家介紹的修復jQuery tablesorter無法正確排序的bug,希望對大家有所幫助!
相關(guān)文章
jQuery中(function($){})(jQuery)詳解
本文通過具體示例向大家詳細介紹了jQuery中的(function($){})(jQuery)的用法和意義,對此有相同困惑的小伙伴可以參考下本文。2015-07-07
jquery調(diào)整表格行tr上下順序?qū)嵗v解
這篇文章主要為大家介紹了jquery調(diào)整表格行tr上下順序?qū)嵗?,具有一定的參考價值,感興趣的朋友可以參考一下2016-01-01
jquery.uploadifive插件怎么解決上傳限制圖片或文件大小問題
jQuery.uploadifive插件可以很好的解決上傳限制圖片或文件大小問題,具體實例代碼大家參考下本文2017-05-05
動態(tài)設(shè)置form表單的action屬性的值的簡單方法
下面小編就為大家?guī)硪黄獎討B(tài)設(shè)置form表單的action屬性的值的簡單方法。小編覺得挺不錯的,現(xiàn)在就分享給大家,也給大家做個參考。一起跟隨小編過來看看吧2016-05-05

