我正在尝试使用bootstrap popup来动态生成表。在表格中有一个列名users
,它包含每个项目的用户数。
例如:表格结构
item name | adress | users
bla..blaa | bla.. | 4
现在,我需要在点击4
时显示包含用户信息的弹出窗口。
用户列HTML是这样的:
<a href='javascript:void(0);' data-rel='popover' title='' data-content='Heads up! This alert needs your attention, but its not super important.' class='badge badge-inverse popup'>4</a>
这是我在查询中尝试的方式:
$('#view_table').find('[data-rel=popover]').popover({html:true});
但是,当我点击用户列下的4
时,它不会触发播放。平均时间我检查了表外的相同HTML,我可以让它工作。
任何想法都不能在表内工作。
希望有人可以帮助我。
答案 0 :(得分:0)
你在写
吗?$('#view_table').find('[data-rel=popover]').popover({html:true});
代码之后,将表格的HTML绑定到DOM,或之前。
在将表添加到DOM
之后,尝试编写上面的代码