修复jQuery tablesorter无法正确排序的bug(加千分位数字后)
更新时间:2016年03月30日 11:18:28 投稿:mrr
这篇文章主要介绍了如何修复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,希望对大家有所帮助!
相关文章
jquery对所有input type=text的控件赋值实现方法
下面小编就为大家带来一篇jquery对所有input type=text的控件赋值实现方法。小编觉的挺不错的,现在就分享给大家,也给大家做个参考。一起跟随小编过来看看吧2016-12-12
jquery 利用show和hidden实现级联菜单示例代码
级联菜单的实现方法有很多,在本文为大家介绍下使用show和hidden轻松实现下级联效果,感兴趣的朋友可以参考下,希望对大家有所帮助2013-08-08


最新评论