Last post Aug 04, 2010 01:45 AM by Bober Song - MSFT
Aug 03, 2010 09:50 AM|BrianFan|LINK
I have a table in my View, which I populate rows in dynamically via jQuery. Below is my jQuery and my table code:
var rowCount = $('#tblAddedParts tr').length;
//Here we need to get data.elementNames and add a table row to the table along with images for delete.
$('#tblAddedParts > tbody:last').append('<tr>' +
'<td style="width:30px;"><img id="imgBtnDeleteRow" alt="Delete" onclick="RemoveRow(this);" onmouseover="this.style.cursor=\'pointer\';" src="../../Content/icons/delete-icon.png" /></td>' +
'<td style="border-bottom: solid 1px Silver; width:40px;">' + data.FSC + '</td>' +
'<td style="border-bottom: solid 1px Silver; width:70px;">' + data.NIIN + '</td>' +
'<td NOWRAP style="border-bottom: solid 1px Silver;"><div style="width:230px; overflow:hidden;">' + data.NAME + '</div></td>' +
'<td style="border-bottom: solid 1px Silver; width:20px;">' + data.UI + '</td>' +
'<td style="border-bottom: solid 1px Silver; width:30px;">' + data.AVAIL + '</td>' +
'<td style="border-bottom: solid 1px Silver; width:30px;">' + $('#txtShipQty').val() + '</td>' +
<div id="NewPartDataTable" style="float:right; width:60%; overflow:auto; height:200px;">
<table id="tblAddedParts" cellspacing="5px">
The problem that I am having is that my entire page is wrapped in a form. I am using the jQuery tabs, and have 4 tabs that collected different information. The last tab is where the user will submit all of the data on the page. I need the data that is populated
for FSC, NIIN, NAME, UI, AVAIL QTY, and REQ QTY in my table to also get submited into my FormCollection in the controler ActionResult. Since these field in the table are not within a control, and don't have an id, I have no idea how to accomplish this.
Any help would be appreciated. THANKS!!
Aug 04, 2010 01:45 AM|Bober Song - MSFT|LINK
Hi BrianFan ,
As far as I know, you need to add tags for those values. or you can try to add all values to one string in one hidden filed, then you can get the hiddenfiled in the controller and you can spilt that string value to all items which you want.
I hope it is helpful to you.