javascript - 我如何制作一个 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');
});});
解决方案
您的代码可能有效。我在这里更新了,检查一次。
(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');
});
});
推荐阅读
- excel - 删除包含特定字符串的行,同时保留单元格为空白的行
- ionic3 - 如何在离子中使用多部分
- java - Java将子类型实例添加到超类型集合中?
- node.js - How to display html link inside table cell using reactjs material-table
- django - 在 django 模板中解码一个值
- python - 如何在python中将SQL查询结果发送到电子邮件
- c# - 如何通过获取nodes.text并设置为true或false来填充Treeview node.checked为true或false
- sql-server - 每日更新来自文件的前缀和来自其他文件的动态编号
- javascript - 如何引用将在脚本加载后声明的函数
- grails - Grails 域对象读取忽略某些列