jQuery Table Plugin Bootstrap Table

Add-ons
2026-07-26 01:18 5 次浏览 • 0 次下载 1.7KB
jQuery Table Plugin Bootstrap Table

For detailed usage instructions, please refer to the demo, which provides comprehensive explanations.

Updated on 2016-10-26 (Fixed errors in the demo file and incorrect reference paths in the downloaded files)

Note: An external JSON file is loaded. Local preview may encounter cross-origin issues, so it needs to be run on a server.

The following is provided byMorning Breeze-Provides

Bug Description

When setting the field formatter using tag attributes, it was found that it had no effect:
Example: <th data-field="sex" data-formatter="format_sex">Gender</th>

Cause:

In bootstrap-table.js, line 399, the code only checks whether the formatter type is function.


Solution:

Modify the code block on line 399:

Before modification

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

After modification:

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);
}
}
星河码客

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

关于本站

联系我们

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

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

Powered by Nuxt · Deployed on Cloudflare