首页 > 解决方案 > 我如何制作一个 booststraps 行 clickabel 并使用相同的行 id 打开一个模式

问题描述

我如何制作一个 booststraps 行 clickabel 并使用相同的行 id 打开一个模式,表信息来自数据库。使用 ajax

$(function (){

 $('#realizePay').modal({
    keyboard: true,
    backdrop: "static",
    show: false,

}).on('show', function () {
});

$(".loan_table").find('td').on('click', function () {
    debugger;

    $('#idPay').html($('<input type="text" id="idread" name="" class="form-control">'));
    $('#realizePay').modal('show');
});});

标签: javascriptajax

解决方案


您的代码可能有效。我在这里更新了,检查一次。

(function (){

 $('#realizePay').modal({
    keyboard: true,
    backdrop: "static",
    show: false,
}).on('show', function () {
    // your ajax call or whatever actions you want on modal show.
});

$(document).on('click', ".loan_table tr", function () {
    debugger;

    $('#idPay').html($('<input type="text" id="idread" name="" class="form-control">'));
    $('#realizePay').modal('show');
});
});

推荐阅读