动态添加文本到列 [英] Dynamically add text to column

查看:80
本文介绍了动态添加文本到列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,有人可以帮助如何动态添加文本到列然后添加Html(break)然后添加下几行,每个段落在一个列之前(break)必须动态创建动作链接,如果你看看我的下表结构,我必须在最后一个列中添加带有
的动态行,然后按照下一个最后一列的动作链接。

 function Test() {
var i = 0 ;
var t = document.getElementById(' Applicant_Table');
$( #Applicant_Table tr)。each(function(){
var val1 = $(t.rows [i] .cells [ 0 ])。text();
if (val1 == _Appcnt_id)
i ++;
});
}

@ foreach (模型中的var项目){
@Html .DisplayFor(modelItem => item.applicant_id)
@ Html .CheckBox( 申请人 new {id = item.applicant_id})
< span class =code-sdkkeyword> @ Html .DisplayFor(modelItem => item.name)
@ Html .DisplayFor(modelItem => item.phone)
@ Html .DisplayFor(modelItem => item.physical_address)
@Html .ValueFor(modelItem => item.date_entered, {0:dd / MM / yyyy}

------



我尝试了什么:



 $(t.rows [i] .cells [ 6  ])。文本()=测试

解决方案

# Applicant_Table tr)。each(function(){
var val1 =


(t.rows [i] .cells [ 0 ])文本();
if (val1 == _Appcnt_id)
i ++;
});
}

@ foreach (模型中的var项目){
@Html .DisplayFor(modelItem => item.applicant_id)
@ Html .CheckBox( 申请人 new {id = item.applicant_id})
< span class =code-sdkkeyword> @ Html
.DisplayFor(modelItem => item.name)
@ Html .DisplayFor(modelItem => item.phone)
@ Html .DisplayFor(modelItem => item.physical_address)
@Html .ValueFor(modelItem => item.date_entered, {0:dd / MM / yyyy}

------



我尝试了什么:



 


(t.rows [i] .cells [ 6 ])。文本()=测试


Hi There, can some one help how to dynamically add a text to a column and then add Html (break) then add next few line, each paragraph in a column before (break) has to create action link dynamically, if you look at my below table structure, i have to add dynamic lines with
in the last colum and then follows action link next last column.

function Test(){
  var i = 0;
  var t = document.getElementById('Applicant_Table');
  $("#Applicant_Table tr").each(function () {
    var val1 = $(t.rows[i].cells[0]).text();
    if (val1 == _Appcnt_id)
      i++;
    });
}

@foreach (var item in Model) {
@Html.DisplayFor(modelItem => item.applicant_id)
@Html.CheckBox("Applicant", new { id=item.applicant_id})
@Html.DisplayFor(modelItem => item.name)
@Html.DisplayFor(modelItem => item.phone)
@Html.DisplayFor(modelItem => item.physical_address)
@Html.ValueFor(modelItem => item.date_entered, "{0:dd/MM/yyyy}")

------

What I have tried:

$(t.rows[i].cells[6]).text()=test

解决方案

("#Applicant_Table tr").each(function () { var val1 =


(t.rows[i].cells[0]).text(); if (val1 == _Appcnt_id) i++; }); } @foreach (var item in Model) { @Html.DisplayFor(modelItem => item.applicant_id) @Html.CheckBox("Applicant", new { id=item.applicant_id}) @Html.DisplayFor(modelItem => item.name) @Html.DisplayFor(modelItem => item.phone) @Html.DisplayFor(modelItem => item.physical_address) @Html.ValueFor(modelItem => item.date_entered, "{0:dd/MM/yyyy}")

------

What I have tried:


(t.rows[i].cells[6]).text()=test


这篇关于动态添加文本到列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆