I have a popup for download using this code.
<a class="btn btn-default" data-toggle="modal" data-target="#addModal"> test</a>
It works without any problems. Now I need to do the same (a pop-up window will also appear) when the user double-clicks on a row of a table that is on the same page. How can i do this?
Try this code:
$('tr').on('dblclick', function() { $('#addModal').modal('show'); });
Since the modal is already initialized with the data settings on the ( data-target="#addModal") button , you just need to bind the event dblclickand show the modal value with .modal('show').
data-target="#addModal"
dblclick
.modal('show')
: http://plnkr.co/edit/J0SuQdy00dcf9baE7xJu?p=preview
"show" bootstrap modal .
- -
$('tr').dblclick(function(){ $('#addModal').modal('show'); })
This should work :) listen to the double-click and then launch the modal manual.
$('.table-row').on('dblclick', function(){ $('#addModal').modal('show') });
Source: http://getbootstrap.com/javascript/#modals