jquery表格插件Bootstrap Table

插件特效
2026-07-26 01:18 5 次浏览 • 0 次下载 1.7KB
jquery表格插件Bootstrap Table

详细用法请查看demo,说明很详细。

2016-10-26更新(修改演示文件错误,和下载文件中引用地址错误问题)

注:加载了外部json文件,本地预览会有跨域问题,需要在服务端运行。

以下由晨之风-提供

Bug描述

用标签属性方式设置字段formatter时,发现没有效果:
如:<th data-field="sex" data-formatter="format_sex">性别</th>

原因:

bootstrap-table.js第399行,代码中只判断了formatter typeof 为function的情况


解决办法:

修改第399行代码块:

修改前

1
2
3
if (typeof that.header.formatters[j] === 'function') {
value = that.header.formatters[j](value, item);
}

修改后:

1
2
3
4
5
6
7
if (typeof that.header.formatters[j] === 'function') {
value = that.header.formatters[j](value, item);
}else if(typeof that.header.formatters[j] === 'string') {
if(typeof window[that.header.formatters[j]] === 'function') {
value = window[that.header.formatters[j]](value, item);
}
}
星河码客

发现和分享优质开源项目,传承互联网精神,为开发者服务。

关于本站

关于我们

隐私政策

侵权投诉

站长:IT小君

粤ICP备20043561号

2016-2046 © 星河码客

联系我们

微信/广告合作:ITcloub (备注星河码客)

免责声明:本站资源版权归原作者所有,仅供学习与交流。如有侵权,请通过「关于我们 - 侵权投诉」联系删除。

Powered by Nuxt · Deployed on Cloudflare