修復jQuery tablesorter無法正確排序的bug(加千分位數字后)
來源:易賢網 閱讀:1166 次 日期:2016-07-14 17:08:07
溫馨提示:易賢網小編為您整理了“修復jQuery tablesorter無法正確排序的bug(加千分位數字后)”,方便廣大網友查閱!

這篇文章主要介紹了如何修復jQuery tablesorter無法正確排序的bug(加千分位數字后)的相關資料,需要的朋友可以參考下

找到函數:

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,''));

}

以上內容是小編給大家介紹的修復jQuery tablesorter無法正確排序的bug,希望對大家有所幫助!

更多信息請查看網絡編程
關于我們 | 聯(lián)系我們 | 人才招聘 | 網站聲明 | 網站幫助 | 非正式的簡要咨詢 | 簡要咨詢須知 | 新媒體/短視頻平臺 | 手機站點

版權所有:易賢網