//edit function
$('#dataTable tbody').on('click', '.am-text-secondary', function() {
//get the id of selected row
var rowData = table.row($(this).parents('tr')).data();
var updateId = rowData.id;
if(!updateId)
return;
console.log("updateId_1:"+updateId);
$.ajax({
url: "getDataById.do?id="+updateId,
success: function (data) {
//assign the editModal
}
});
$('#editModal').modal({
relatedTarget: this,
width:600,
onConfirm: function(options) {
console.log("updateId_2:"+updateId);
$.ajax({
//do something
});
}
});
});
当第一触发编辑功能,updateId_1和updateId_2示出26.数据表JS变量不被更新
但随后第二触发器,updateId_1示出了27,updateId_2仍显示26 ...
问题在哪里?
你使用哪种插件模式? –