How to pass row data to a modal?
How to pass row data to a modal?
don2
Posts: 27Questions: 15Answers: 0
I'm trying to call modal from row and show the details in there, but it looks like it doesn't select correct data row.
anybody please help..many thanks in advance
columns: [
{
data: 'iccid', className: 'text-left', responsivePriority: 1,
render: function (data, type, row) {
return '<a onclick="Show_ICCID_Info(' + data + ');" data-id="' + data + '" href="#iccidInfo">' + data + '</a>';
}
},
function Show_ICCID_Info(data)
{
alert(data); // I check the data here!, but it receives wrong data
var elICCIDInfo = document.getElementById('iccidInfo');
var iccidInfo = new bootstrap.Modal(document.getElementById('iccidInfo'), {
keyboard: false
});
$(".modal-body #modalSIMsPid").val(data);
This question has an accepted answers - jump to answer
Answers
I think you will be better off using jQuery delegated events like this example.
Kevin