Posted on 2011-12-15 09:23
哈希 阅读(7822)
评论(1) 编辑 收藏
因为这个tr需要动态增加和删除,并且获得td中的值
<script src="js/jquery-1.3.2.js" type="text/javascript"> </script>
<script type="text/javascript">
function addit(){
var n = $("#paramTable tr:last td").eq(1).html();
if(isNaN(n)) n = 1;
else n++;
$("#paramTable").append("<tr><td>name</td><td>" + n + "</td><td onclick='delit(this);'>删除</td></tr>")
}
function delit(obj){ $(obj).parent().remove();} </script>
<input type="button" onclick="addit()" value="添加">
<table border=1 id="paramTable">
<tr>
<td width=100>
参数名称
</td>
<td width=100>
对应列号
</td>
<td width=60>
是否删除
</td>
</tr>
<tr>
<td>name</td>
<td>1</td>
<td onclick="delit(this);">删除</td>
</tr>
</table>
function getMerchandiseTable(){
var arrMerchandise = [];
$("#tbOrderMerchandise tr").each(function(){
var $MerchandiseIdTd = $("td:eq(0)",$(this) );//商品ID
var $quantityTd = $("td:eq(3)",$(this) );//数量
var $priceTd=$("td:eq(6)",$(this) );//小计
var $DescriptionTd = $("td:eq(7)",$(this) );//备注
if($MerchandiseIdTd.text()!="")
{
arrMerchandise.push($MerchandiseIdTd.text()+"|"+$quantityTd.text()+"|"+$priceTd.text()+"|"+$DescriptionTd.text());
}
});
$("#hidDetailList").val(arrMerchandise.join(","));
}
private List<hanvnet.Dto.Page.Table.DeliveryFeePage> GetDeliveryFeeList(string strChargerId)
{
string strFeeInput = hdFeeList.Value;
List<hanvnet.Dto.Page.Table.DeliveryFeePage> lstFee
= new List<hanvnet.Dto.Page.Table.DeliveryFeePage>();
hanvnet.Dto.Page.Table.DeliveryFeePage deliveryFeePage = null;