I'm using Knockout and Bootstrap together. An anchor tag that is not within a knockout template shows a nice tooltip affect, but those within the template do not. Given html outside a template (this works: a styled tooltip appears below the anchor)
<a data-original-title="Setup" href="'Setup" class="tip-bottom"><i class="icon-th"></i>Setup</a>
Given a knockout template
<tbody data-bind="foreach: {data: providers, afterRender: KoAfterRender}">
<tr class="">
<td class="taskOptions">
<a href="#" class="tip-top" data-original-title="Update"><i class="icon-ok"></i></a>
</td>
</tr>
</tbody>
And a function within my ViewModel
function koAfterRender(element, index, data) {
$('.taskOptions a').popover();
}
obj.KoAfterRender = koAfterRender;
I was hoping to be able to manually apply the .popover function as per this article, but applying the function has no effect (no errors either).
What am I going wrong?
Thanks.
EDIT: I've realised that my code (and the custom binding code helpfully added by Paul Manzotti) both actually work - the problem is that even if I apply .popover() to the anchor in a template it still does not show a tooltip.
EDIT2: I'm an idiot. .popover() is the wrong function. I want .tooltip()