Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9208325
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T00:35:30+00:00 2026-06-18T00:35:30+00:00

I am trying to put html in the bootstrap popover and the content shows

  • 0

I am trying to put html in the bootstrap popover and the content shows nicely but when I click on my links inside the popover it just goes to the parent ‘OpenRecent’ method on the anchor tag that triggers the popover. You can see below in the data-content html the different ways I try to call the function I want. How can I achieve this?

<ul id="RecentSearches" class="nav nav-tabs nav-stacked well" data-bind="foreach: CurrentItems">
        <li>
            <div>
                <input type="checkbox" class="checkbox inline" data-bind="value: $data.TransId,
                                                                          checked: $root.ItemsSelected"/>
                <a href="#"
                   data-bind="text: $data.Description + '-' + $data.County,
                              attr: 
                              { 
                                id: $data.TransId,
                                'data-title': $data.Description
                              },
                              click: $root.OpenRecent"
                   data-trigger="hover"
                   rel="popover"
                   data-html="true"
                   data-content="<a data-bind='click: $parent.Print.bind($data)'>Print</a> |
                                 <a data-bind='click: app.RecentSearches.Print.bind($data)'>Print 2</a>
                                 <a data-bind='click: $parent.Email'>Email</a> |
                                 <a data-bind='click: $parent.SaveToPDF'>PDF</a> |
                                 <a data-bind='click: $parent.SavetToCSV'>CSV</a>">
                </a>
            </div>
        </li>
    </ul>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T00:35:32+00:00Added an answer on June 18, 2026 at 12:35 am

    The HTML is your data-content will not have been bound by Knockout, as it was added dynamically later.

    One option is to add a way to identify the links (class) and then use an unobstrusive approach to adding an event handler.

    $("ul").on("click", ".print", function(event) {
         var context = ko.contextFor(this);
         context.$root.Print(context.$data);
         event.preventDefault();
    });
    

    I am not sure why your OpenRecent function is getting called. It appears to me that bootstrap creates the popover outside of the element that it is triggered on. So, this would not be a parent of the popover. If you are still having an issue with that part, then maybe you could get it working in jsFiddle.

    Here is a fiddle with the unobtrusive handler: http://jsfiddle.net/rniemeyer/Edww3/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to put some HTML content inside <content:encoded> tags using ROME and its
I am trying to put a click function on a php loop. But its
The following html shows a item information. I'm trying put the avaliation span on
Using html/CSS I am trying to put a little div with two images inside
For the html below, I am trying to put a variable to just oakbarrels
I have a html/css based menu and I'm trying to put a flash video
Trying to put in field pagar the calculated value of precio * 15% but
I'm trying to put some simple jQuery code into the Wordpress header (usually just
I am trying to put into a string the HTML after a h1 tag
i am trying to put context path for an image in HTML. <img src=/MyWeb/images/pageSetup.gif>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.