0

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.

David Bélanger
  • 7,400
  • 4
  • 37
  • 55

1 Answers1

2

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.

juanjosegzl
  • 64
  • 10
  • This is what I finally done. When the checkbox get updated within the popover, it's update the other checkbox. They are link with a custom HTML5 attributes `data-checkbox_id` and they share the same ID. It's working like a charm. Not the best solution, but the job get done. – David Bélanger Apr 10 '13 at 12:13