修复jQuery tablesorter无法正确排序的bug(加千分位数字后)

2019-12-17教程大全280673

找到函数:

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 html表格排序插件tablesorter使用方法详解
  • jQuery排序插件tableSorter使用方法
  • jquery.tableSort.js表格排序插件使用方法详解
  • 针对后台列表table拖拽比较实用的jquery拖动排序
  • 通过jquery-ui中的sortable来实现拖拽排序的简单实例
  • jQuery实现带分组数据的Table表头排序实例分析
  • jQuery表格排序组件-tablesorter使用示例
  • 用jquery.sortElements实现table排序
  • jquery实现的鼠标拖动排序Li或Table
  • jquery中的sortable排序之后的保存状态的解决方法
  • JQuery 构建客户/服务分离的链接模型中Table中的排序分析
  • jquery tablesorter.js 支持中文表格排序改进
  • jquery实现的table排序功能示例
本文地址:https://www.ufcn.cn/it/247127.html

如非特殊说明,本站内容均来自于网友自主分享,概不代表本站观点,如有任何问题我们都将在收到反馈后的第一时间进行处理!