Search code examples
knockout.jsknockout-sortable

using knockout sortable with bootstrap popover


To use bootstrap popover, I'm using knockout-bootstrap but am ok with using something else as in the answer of Adam Marshall here

Normally , on a button click event, I would use it as below..

<button class="btn" data-bind="popover: {template: 'popoverBindingTemplate', title: 'Popover', trigger: 'click'}">

I wish to trigger the popover on students in tables in the knockout sortable example. jsfiddle:

I can not use it on click event as it throws an error : Multiple bindings (text and popover) are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.

Is there any way to open the popover maybe on 'aftermove' (drop) event.

I tried calling a method like below but it did not show anything even on console.log().

 <div class="student" data-bind="visible: gender() == 'male', text: '[M]'+name(),afterMove: openpopover"></div>`

Any help is sincerely appreciated..

Thanks


Solution

  • <div>  
     <span class="student" data-bind="text: name()"></span> 
     <button class="btn btn-xs btn-success"  data-bind="popover: {template: 'popoverBindingTemplate', title: 'Popover', trigger: 'click'}">-</button>
    </div>