jquery - 我想将模式中的值从我们编辑的行发送到表格
问题描述
我在编辑表中的行时设置了这些值。
var indexrows = $(d).closest("tr").index();
var currentrow = $(d).closest("tr");
这是表名:$('#tblindeximage')
这是模态中的值:
var pd_head_name = $('#index_head_name').val();
var pd_detail_name = $('#index_detail_name').val();
我想发送到我们调用模态的行:
$("td:eq(" + indexrows + ")", $(currentrow)).find('.cls-pd_main_head').html(pd_head_name);
解决方案
你的代码:
$("td:eq(" + indexrows + ")", $(currentrow)).find('.cls-pd_main_head').html(pd_head_name);
可能的解决方案:
$("td:eq(" + indexrows + ")", $(currentrow)).find('.cls-pd_main_head').text(pd_head_name);
更新:
如果$('#index_head_name').val();
什么都不返回。将其更改为.text();
推荐阅读
- reactjs - 不变违规:浏览器历史记录需要一个 DOM
- d3.js - 不从零开始的条形图
- amazon-web-services - AWS - 无法通过 443 端口访问 EC2 实例
- radio-button - 如何在默认情况下使用 bootbox 提示检查单选按钮
- java - 如何将数据源 url 查询参数添加为 application.properties?
- postgresql - PostgreSQL 表导出自动化
- testing - 在常见的 spring 上下文中运行 Spock 测试
- kubernetes - 我们可以在 Kubernetes 中配置相同的节点作为主从节点吗
- intellij-idea - 查看哪些方法没有对 intelj idea 进行单元测试
- python - 创建一个 DataFrame 为参数'index'返回多个值