Link in each row (opening a modal)
Link in each row (opening a modal)
ninjaweb
Posts: 4Questions: 0Answers: 0
Hi,
I put a link in each datatable rows, by clicking on it, it should open a bootstrap modal for confirm.
Here's the code for the link:
[code]Link[/code]
Here's the code for the modal:
[code]
×
Text
Some text
No
Yes
[/code]
Here's the code for the jquery:
[code]$(document).ready(function(){
//Modals
$("#trial_link").on('click',(function(){
//alert("this is a trial");
$("#btnYes").attr("href", $(this).attr("data-link"));
$("#delConfirm").modal('toggle');
return false;
}));
});[/code]
After this, nothing happen if the link is clicked. I thought I've done wrong with modal code, so I put a simple alert (uncommented of course), but nothing happen again.
Any help?
I put a link in each datatable rows, by clicking on it, it should open a bootstrap modal for confirm.
Here's the code for the link:
[code]Link[/code]
Here's the code for the modal:
[code]
×
Text
Some text
No
Yes
[/code]
Here's the code for the jquery:
[code]$(document).ready(function(){
//Modals
$("#trial_link").on('click',(function(){
//alert("this is a trial");
$("#btnYes").attr("href", $(this).attr("data-link"));
$("#delConfirm").modal('toggle');
return false;
}));
});[/code]
After this, nothing happen if the link is clicked. I thought I've done wrong with modal code, so I put a simple alert (uncommented of course), but nothing happen again.
Any help?
This discussion has been closed.
Replies
Allan