Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
433 views
in Technique[技术] by (71.8m points)

bootstrap table fixed插件当window.resize时有问题

bootstrap table
1.使用fixed插件表格会随着窗口的最大化最小化乱掉,用$(table).bootstraptable(options) 当窗口变大变小时,表格的排版会乱掉
2.同样用$(table).bootstraptable(options) 这个初始化后,当页面中有多个表格的时候,resetWidth只对最后一个表格起作用,其余的表格不起作用
有空的话,麻烦看下,对js了解还不够透彻,还请多多指教,谢谢~


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

这个貌似是bug,注册回调时候,用了统一的名字,导致后插入的表格,把之前的回调给覆盖了。
注册的函数名加上标签id即可,比如
$(window).off('resize.bootstrap-table'
$(window).on('resize.bootstrap-table'

改成,'resize.bootstrap-table'+this.$el[0].id


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
...