sir i want to show data dynamically in modal when clicking a table row using bootstrap
What I have tried:
//=== js
function BindTable() {
$("#tblselect tbody").find('tr').remove();
var row = "";
$.ajax({
type: "POST",
url: "wsc_common.asmx/bindtable",
data: "{}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (msg) {
var json = JSON.parse(msg.d);
$.each(json, function (index, obj) {
var row = ' ' + obj.pid + ' ' + obj.p_name + ' ' + obj.p_mobile + ' ' + obj.p_location + ' '
$("#tblselect tbody ").append(row);
});
}
});
}
//=== popup
$(function(){
$('#orderModal').modal({
keyboard: true,
backdrop: "static",
show:false,
}).on('show', function(){
var getIdFromRow = $(event.target).closest('tr').data('id');
//make your ajax call populate items or what even you need
$(this).find('#orderDetails').html($(' Order Id selected: ' + getIdFromRow + ''))
});
});