Bootstrap Popover - Save HTML on close

爱⌒轻易说出口 提交于 2019-12-12 05:48:10

问题


I have an order page where you select what type of products you want. For specific products, they have something call "specifications". When there's a button, it mean that there's specifications. If you click on it, a popover appear with a list of checkbox. This is working fine and without problem.

Now the problem I have is, when I click back again, the popover close (also ok) but the data doesn't save. I assume it does a copy from the content and cache it.

My question, is there a way to save the data when it close or use "live" data from a DIV within the popover ?

Thanks you.

EDIT:

What you want in the equipment list:

<div id="specs-1" class="hide">
    <ul class="specs-group unstyled">
        <li>...</li>
    </ul>
</div>
<a href="#" rel="popover" data-original-title="Specifications" data-placement="top">S</a>

The content of the DIV goes in the POPOVER. Now, when the contnet change, I want it to reflect in the DIV.

Thanks.


回答1:


You have to manage close event of the button. It seems there is not a callback on twitter's bootstrap popover so you have to do it manually.

If you have full control of content displayed on popover you should assign to elements a way to identify them, an id for example, then bind elements to a javascript function. With the function you can copy content from popover to the div.



来源:https://stackoverflow.com/questions/15905975/bootstrap-popover-save-html-on-close

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!