本文介绍了Ienumrabel view tabel< tr> < td> displyefor< / td>< / tr>值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
i在这里混淆,
i创建一个模型的IEnumerable列表视图,
和按钮点击列表视图表我需要所有单元格值/文件
请在这里帮助我
我尝试过:
< div class =Datadiv>
< div class =sbox pull-right>
@using(Html.BeginForm(ConvertrWorker,Perchus,FormMethod.Get))
{
}
< / div>
< table class =tbl1 table-responsive table-hover table-borderedid =tbl1style =width:100%>
< tr style =background-color:palegoldenrod; height:135%class =data1>
< td style =width:30%>
SypplyerName
< / td>
< td>
Challa否
< / td>
< td>
ChallaDate
< / td>
< td>
TaxAmount
< / td>
< td>
Challan金额
< / td>
< td> Control< / td>
< td> Control< / td>
< / tr>
@foreach(模型中的var项)
{
< tr style =background-color:#eff6de>
< td class =hfr>
@ Html.HiddenFor(modelItem => item.PerTranChallanId,new {@class =PerTranChallanId})
@ Html.HiddenFor(modelItem => item.PTranCode,new {@class = PTranCode})
< / td>
< td class =sn1>
@ Html.DisplayFor(modelItem => item.SypplyerName,new {@ class =sn,@ id =SypplyerName})
< / td>
< td>
@ Html.DisplayFor(modelItem => item.ChallaNo)
< / td>
< td>
@ Html.DisplayFor(modelItem => item.ChallaDate)
< / td>
< td>
@ Html.DisplayFor(modelItem => item.TaxAmount)
< / td>
< td>
@ Html.DisplayFor(modelItem => item.TotalAmount)
< / td>
< td>
@ Html.ActionLink(详情,Showchl1,新{id = item.PerTranChallanId,PTranCode = item.PTranCode})|
< / td>
< td class =con>
< input type =submitid =convtname =convtvalue =Add to INv No: - @ ViewBag.NewINVNo1class =convt btn btn-success/>
< / td>
< td class =csl>
< input type =submitid =canselname =cancelvalue =从INv取消否: - @ ViewBag.NewINVNo1class =convt btn btn-danger/>
< / td>
< / tr>
}
< / table>
< / div>
< / div>
jquery
<脚本>
$(document).ready(function(){
$(document).on('click','convt',function(){
var $ supplyer = $(this) .closest(tr)。find(。sn)。val();
alert($ supplyer);
})
});
< / script>
解决方案
hi ,
i am confuse here ,
i create a IEnumerable list view of model ,
and on button click on list view table i need all cell value /text
Please help me here
What I have tried:
<div class="Datadiv"> <div class="sbox pull-right"> @using (Html.BeginForm("ConvertrWorker", "Perchus", FormMethod.Get)) { } </div> <table class="tbl1 table-responsive table-hover table-bordered" id="tbl1" style="width:100%"> <tr style="background-color:palegoldenrod;height:135%" class="data1"> <td style="width:30%"> SypplyerName </td> <td> Challa No </td> <td> ChallaDate </td> <td> TaxAmount </td> <td> Challan Amount </td> <td>Control</td> <td>Control</td> </tr> @foreach (var item in Model) { <tr style="background-color:#eff6de"> <td class="hfr"> @Html.HiddenFor(modelItem => item.PerTranChallanId, new { @class = "PerTranChallanId" }) @Html.HiddenFor(modelItem => item.PTranCode, new { @class = "PTranCode" }) </td> <td class="sn1"> @Html.DisplayFor(modelItem => item.SypplyerName ,new {@class="sn", @id = "SypplyerName" }) </td> <td> @Html.DisplayFor(modelItem => item.ChallaNo) </td> <td> @Html.DisplayFor(modelItem => item.ChallaDate) </td> <td> @Html.DisplayFor(modelItem => item.TaxAmount) </td> <td> @Html.DisplayFor(modelItem => item.TotalAmount) </td> <td> @Html.ActionLink("Details", "Showchl1", new { id = item.PerTranChallanId , PTranCode=item.PTranCode }) | </td> <td class="con"> <input type="submit" id="convt" name="convt" value="Add To INv No:- @ViewBag.NewINVNo1" class="convt btn btn-success " /> </td> <td class="csl"> <input type="submit" id="cansel" name="cancel" value="Cancel From INv No:- @ViewBag.NewINVNo1" class="convt btn btn-danger " /> </td> </tr> } </table> </div> </div>
jquery
<script> $(document).ready(function () { $(document).on('click', 'convt', function () { var $supplyer = $(this).closest("tr").find(".sn").val(); alert($supplyer); }) }); </script>
解决方案
这篇关于Ienumrabel view tabel< tr> < td> displyefor< / td>< / tr>值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!