jquery - Twitter Bootstrap Popover with dynamically generated content via ajax -


i'm willing set bootstrap popover show emails list have been sent user. content therefore dynamically generated via ajax call. here piece of code :

    $('#liste').on('mouseover', 'tr[data-toggle=popover]', function(e) {         var $tr = $(this);         id = $(this).data('id');         $.ajax({             url: '<?php echo $this->url(array(), 'loadrelance');?>',             data: {id: id},             datatype: 'html',             success: function(html) {                 $tr.popover({                     title: 'relance',                     content: html,                     placement: 'top',                     html: true,                     trigger: 'hover'                 }).popover('show');             }         });     }); 

as can see, it'll trigger ajax call on each mouseover on <tr>'s of <table>. works when page loaded first time, when make change in number of mail sent, doesn't show updated list when on again (it works if reload page of course). can see in preview of xhr requests in chrome developper toolbar updated list doesn't load in content of popover. keeps old list.

any appreciated. thanks!

you should destroy existing popover using:

$tr.popover('destroy'); 

then create new popover using code:

$tr.popover({options}).popover('show'); 

Comments

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -