Help in JQuery for looping in a gridview
-
Hi all, I am using ASP.NET 2.0.I have a gridview which has 5-6 columns and two template columns, one containing a dropdownlist and other containing a textbox.The grid also contains three columns viz Itemcode, BatchNo and LOtNo, all three combine to form the primary key of the table.Now on a button click which is outside the grid ,i need to check that the Sum of all the distinct items irrespective of batch, lot be same Actually I have two problems: 1.I used the following code for looping through the grid:
$('#Item_Details tr').each(function() {
if (!this.rowIndex) return;
var packsize = $(this).find("td").eq(3).html();
var ddl_id=$(this).find(':input[type=select]').attr('id');
var textid_id=$(this).find(':input[type=text]').attr('id');here i am able to get the textbox id but ddl id always returns undefined !!!! 2. Whats the best method with which i can group the items and find the sum using jQuery??? Any help would be appreciated....
When you fail to plan, you are planning to fail.
-
Hi all, I am using ASP.NET 2.0.I have a gridview which has 5-6 columns and two template columns, one containing a dropdownlist and other containing a textbox.The grid also contains three columns viz Itemcode, BatchNo and LOtNo, all three combine to form the primary key of the table.Now on a button click which is outside the grid ,i need to check that the Sum of all the distinct items irrespective of batch, lot be same Actually I have two problems: 1.I used the following code for looping through the grid:
$('#Item_Details tr').each(function() {
if (!this.rowIndex) return;
var packsize = $(this).find("td").eq(3).html();
var ddl_id=$(this).find(':input[type=select]').attr('id');
var textid_id=$(this).find(':input[type=text]').attr('id');here i am able to get the textbox id but ddl id always returns undefined !!!! 2. Whats the best method with which i can group the items and find the sum using jQuery??? Any help would be appreciated....
When you fail to plan, you are planning to fail.
var ddl_id = $(this).find(':input[type=select]').attr('id'); You used an error selector. Ex: var ddl_id = $(this).find('select').attr('id');