JavaScript Jasny Bootstrap rowlink Modal invocation

i just found out that there was an extension to bootstrap when i am trying to find something like .row-linkso when i implemented it on my table, i can't seem to invoke a modal on when i click on each row. the modal in boostrap won't be invoke. I really can't trace why cuz when i debugged (using firebug) the page, the td tag where i put my a tag, my a tag link can't be seen. the one that is displayed is only the value of . e.g <a> some link </a>

some link is the only thing i see on firebug, usually when i debug i see all the html tag like so <a target='_blank' href="some link" data-toggle="modal" data-target="some taget"> click me </a> but i really don't know why i can't invoke a modal using row-link

Again, my goal when i click 1 row a modal box appears

here is my code snippet

<table>
   <thead>
        // some headers
   </thead>
   <tbody data-provides="rowlink">
      <tr>
        <td><a target='_blank' href="#myModal" data-toggle="modal" data-target="modal">Click me</a> </td>
        <td>/*some data*/</td>
        <td>/*some data*/</td>
      </tr>
   </tbody>
</table>

<div id="myModal" /*some legit modal attr please see bootstrap site i just copied them*/>
    <div>
        MODAL HEADER
    </div>

    <div>
        MODAL BODY
    <div>

    <div>
        MODAL FOOTER
    <div>
</div>

WHEN I TRIED THIS ONE, NOTE THAT THIS link is outside the table html tag

<a target='_blank' href="#myModal" data-toggle="modal" data-targe="modal">Click me</a>

Anyone knows how to implement modal view inside row-link please do share

Answer:1

If you check this link, the below code takes the href from the link and changes the window.location to href on click of row and hence it's expecting an URL.

var href = link.attr('href')

$(this).find('td').not('.nolink').click(function() {
   window.location = href;
}) 

Also the <a> tag being stripped is also mentioned in their code.

link.replaceWith(link.html())

A solution to tackle this is to manually write a script where in you target the row which will have modal and add the required attribute to the row. See Fiddle. Here I have given a class .rowlink-modal to the tr which one would want to be clickable and target that class in script and add data attributes.

$('.rowlink-modal').each(function(){
 $(this)
   .attr('data-toggle','modal')
   .attr('data-target','#myModal');
});

The 'Action' link if clicked will open modal2 and when you click the whole row the first modal is opened.

Answer:2

I have a wordpress site. Under single.php, I have the following body tag <body <?php body_class(); ?> onLoad="func(<?php echo $thePostID?>);" > Reading articles on the web ...

I have a wordpress site. Under single.php, I have the following body tag <body <?php body_class(); ?> onLoad="func(<?php echo $thePostID?>);" > Reading articles on the web ...

  1. avoid inline conditionals
  2. avoid inline conditionals checkstyle
  3. avoid inline css
  4. avoid inline styles
  5. avoid inline javascript
  6. avoid inline conditionals java
  7. avoid inline conditionals sonar
  8. avoid inline conditionals avoid inline conditionals
  9. avoid inline c++
  10. avoid inline css style attributes
  11. avoid inline scripting
  12. avoid inline attachments
  13. avoid inline conditionals 意味

I am using emberjs for mvc in client side, I'm facing a problem when I would like to delete a record et create another with the same Id of the deleted one. It shows me this error Uncaught Error: ...

I am using emberjs for mvc in client side, I'm facing a problem when I would like to delete a record et create another with the same Id of the deleted one. It shows me this error Uncaught Error: ...

  1. delete records with foreign key constraints
  2. delete records with data loader
  3. delete records with join sql
  4. delete records with condition sql
  5. delete records with referential integrity
  6. delete records with process builder
  7. delete records with flow salesforce
  8. delete records with sql
  9. delete records with linq
  10. delete records with table
  11. delete records from table sql
  12. delete records from table mysql
  13. delete records from table oracle
  14. delete records from hive table
  15. delete records in mysql
  16. delete records from table postgres
  17. delete records from table sql server
  18. delete records in mongodb
  19. delete records in hive
  20. delete records in oracle

I have been fiddling around with HTML lately and I have a question. Is there a way to scope element's id as a child of another element? It's difficult to describe, but here's an example. <body>...

I have been fiddling around with HTML lately and I have a question. Is there a way to scope element's id as a child of another element? It's difficult to describe, but here's an example. <body>...

  1. html javascript scope
  2. html javascript scope variable

How do I redirect the user based on two options on drop down menu's? i have read a few similar questions but couldnt relate the advice as the form code I am using is very long and complicated. I have ...

How do I redirect the user based on two options on drop down menu's? i have read a few similar questions but couldnt relate the advice as the form code I am using is very long and complicated. I have ...

  1. form redirect based on input