首页 > 解决方案 > 我想将模式中的值从我们编辑的行发送到表格

问题描述

我在编辑表中的行时设置了这些值。

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); 

在此处输入图像描述

标签: jquerymodal-dialog

解决方案


你的代码:

$("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();


推荐阅读