I am trying to create and initialize multiple popovers, using the same code. The html element is being created in JS-
var panel = ('<a href="javascript://" id= "'+popId+'" data-title="xyz" >');
popId
is a unique value for each so the ids getting assigned are unique
Next I am calling the following function-
createPopOver("#"+popId,<another_arg>);
The create function looks like this-
function createPopOver(selector,<another_arg>) {
$(selector).popover({
trigger: 'click',
placement : 'left'
}).on('shown.bs.popover', function () {
console.log("reached here1"+selector);
...
});
}
debugging through the control goes to the function however not inside the shown event and so the console does not print anything.
If I give an id="xyz"
so now all the popovers have the same id, the very first popover will show up on clicking but with incorrect text (the content to display is being computed in the create popover function).