问题描述
var bookingitems = new Array();
var bookingitem = {};
$([id * = gvBookingDt] tr)。each(function( ){
bookingitem.ItemNo = $(this).find(span [class * = ItemNo])。html();
bookingitem.ItemDes = $(这个).find(td:nth-child(4))。html();
bookingitem.NoofPieces = $(this).find(td:nth-child(5) ).html();
bookingitem.Weight = $(this).find(td:nth-child(6))。html();
bookingitems .push(bookingitem);
});
我的Gridview包含两条记录:
itemNo Itemdesc noofpcs weight
1手机12 20kg
2笔记本电脑13 50 kg
for(int i = 0; i< = bookingitems.Count-1; i ++){ }
获取olny最后一行值两次
我尝试过:
我试图在里面发出警报(gridvie循环w使用jquery)。在警告框中,它显示两行数据,但为什么它无法在arraylist中推送这两个项目。我不知道。
任何帮助。请......
提前致谢
var bookingitems = new Array();
var bookingitem = {};
$("[id*=gvBookingDt] tr").each(function () {
bookingitem.ItemNo = $(this).find("span[class*=ItemNo]").html();
bookingitem.ItemDes = $(this).find("td:nth-child(4)").html();
bookingitem.NoofPieces = $(this).find("td:nth-child(5)").html();
bookingitem.Weight = $(this).find("td:nth-child(6)").html();
bookingitems.push(bookingitem);
});
My Gridview contains two records:
itemNo Itemdesc noofpcs weight
1 mobile 12 20kg
2 laptop 13 50 kg
when i am trying to find array details
for(int i=0;i<=bookingitems.Count-1;i++){}
Getting olny last row value two times
What I have tried:
I have tried to put an alert inside (loop of gridview using jquery).In alert box,it's showing both two rows data,but why it's not able to push both item in arraylist.I am not getting any idea.
Any help.please......
Thanks in advance
推荐答案
这篇关于为什么我只使用jquery获取数组中的最后一行gridview值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!