修复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中(function($){})(jQuery)详解
本文通过具体示例向大家详细介绍了jQuery中的(function($){})(jQuery)的用法和意义,对此有相同困惑的小伙伴可以参考下本文。2015-07-07jquery.uploadifive插件怎么解决上传限制图片或文件大小问题
jQuery.uploadifive插件可以很好的解决上传限制图片或文件大小问题,具体实例代码大家参考下本文2017-05-05
最新评论