Html表tr / td属性按钮单击popupform以填充数据 [英] Html table tr/td attribute button click popupform to fill data

查看:117
本文介绍了Html表tr / td属性按钮单击popupform以填充数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





有拼图,

i在cshtml表中有列表视图,它有两个按钮1是编辑,2是详情

关于此行属性编辑点击我需要打开一个新的popupForm



i尝试但没有响应后btn点击



需要示例教程



我尝试过:



html table



< table class =tbl1 table table-responsive table-hover table-bordered id =tbl1style =width:100%> 

< tr style =background-color:palegoldenrod; height:135%>
< td class =hidme>< / td>
< td style =width:30%>
@ Html.ActionLink(SypplyerName,ListGetINV2,new {sortOrder = ViewBag.NameSortParm,currentFilter = ViewBag.CurrentFilter})
< / td>
< td>
发票否
< / td>
< td>
@ Html.ActionLink(Invice Date,ListGetINV2,new {sortOrder = ViewBag.DateSortParm,currentFilter = ViewBag.CurrentFilter})
< / td>
< td>
TaxAmount
< / td>
< td>
发票金额
< / td>
< td>< / td>
< / tr>
@foreach(模型中的var项)
{
< tr style =background-color:#eff6de>
< td class =hidme>
@ Html.HiddenFor(modelItem => item.PerTranId,new {@class =PerTranId text-danger})
< / td>
< td>
@ Html.DisplayFor(modelItem => item.SypplyerName)
< / td>
< td>
@ Html.DisplayFor(modelItem => item.InvoiceNo)
< / td>
< td>
@ Html.DisplayFor(modelItem => item.InvoiceDate)
< / td>
< td>
@ Html.DisplayFor(modelItem => item.TaxAmount)
< / td>
< td>
@ Html.DisplayFor(modelItem => item.TotalAmount)
< / td>
< td>
@ Html.ActionLink(编辑,EditInv,新{id = item.PerTranId})|

< input type =submitclass =dtl btn btn-warningid =EditInvonclick =PopupForm('@ Url.Action(EditInv,Perchus)' )/>
< / td>

< / tr>
}
< / table>







jquery code



 var popup; 
$('#EditInv')。on('Click','input.dtl',function(){
function PopupForm(url){
var formDiv = $('< div />');
$ .get(url)
.done(function(response){
formDiv.html(response);

popup = formDiv.dialog({
autoOpen:true,
resizable:false,
title:'EDIT INVOICE REORD',
height:500,
width:600,
close:function(){
popup.dialog('distroy')。remove();
}

});
});

}
})

解决方案

('#EditInv')。 ('Click','input.dtl',function(){
function PopupForm(url){
var formDiv =


('< div /> ;');

.get(url)
.done(function(response){
formDiv.html(response);

popup = formDiv.dialog({
autoOpen:true,
resizable:false,
title:'EDIT INVOICE REORD',
height:500 ,
宽度:600,
关闭:function(){
popup.dialog('distroy')。remove();
}

} );
});

}
})


hi ,

there is puzzle ,
i have list view in cshtml table and its have two button 1 is edit and 2 is details
on this row attribute edit click i need to open a new popupForm

i tried but non of response after btn click

need example tutorial

What I have tried:

html table

<table class="tbl1 table table-responsive table-hover table-bordered" id="tbl1" style="width:100%">

			<tr style="background-color:palegoldenrod;height:135%">
				<td class="hidme"></td>
				<td style="width:30%">
					@Html.ActionLink("SypplyerName", "ListGetINV2", new { sortOrder = ViewBag.NameSortParm, currentFilter = ViewBag.CurrentFilter })
				</td>
				<td>
					Invoice No
				</td>
				<td>
					@Html.ActionLink("Invice Date", "ListGetINV2", new { sortOrder = ViewBag.DateSortParm, currentFilter = ViewBag.CurrentFilter })
				</td>
				<td>
					TaxAmount
				</td>
				<td>
					Invoice Amount
				</td>
				<td></td>
			</tr>
			@foreach (var item in Model)
			{
				<tr style="background-color:#eff6de">
					<td class="hidme">
						@Html.HiddenFor(modelItem => item.PerTranId, new { @class = "PerTranId text-danger" })
					</td>
					<td>
						@Html.DisplayFor(modelItem => item.SypplyerName)
					</td>
					<td>
						@Html.DisplayFor(modelItem => item.InvoiceNo)
					</td>
					<td>
						@Html.DisplayFor(modelItem => item.InvoiceDate)
					</td>
					<td>
						@Html.DisplayFor(modelItem => item.TaxAmount)
					</td>
					<td>
						@Html.DisplayFor(modelItem => item.TotalAmount)
					</td>
					<td>
						@Html.ActionLink("Edit", "EditInv", new { id = item.PerTranId }) |
						
						<input type="submit" class="dtl btn btn-warning" id="EditInv" onclick="PopupForm('@Url.Action("EditInv","Perchus")')" />
					</td>

				</tr>
			}
		</table>




jquery code

    var popup;
$('#EditInv').on('Click', 'input.dtl', function () {
    function PopupForm(url) {
        var formDiv = $('<div/>');
        $.get(url)
            .done(function (response) {
                formDiv.html(response);

                popup = formDiv.dialog({
                    autoOpen: true,
                    resizable: false,
                    title: 'EDIT INVOICE REORD',
                    height: 500,
                    width: 600,
                    close: function () {
                        popup.dialog('distroy').remove();
                    }

                });
            });

    }
})

解决方案

('#EditInv').on('Click', 'input.dtl', function () { function PopupForm(url) { var formDiv =


('<div/>');


.get(url) .done(function (response) { formDiv.html(response); popup = formDiv.dialog({ autoOpen: true, resizable: false, title: 'EDIT INVOICE REORD', height: 500, width: 600, close: function () { popup.dialog('distroy').remove(); } }); }); } })


这篇关于Html表tr / td属性按钮单击popupform以填充数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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