ComponentArt Grid - loop thru grid using javascript
Posted on January 31, 2007 by bigidea
This js function allows us to loop thru records in an componentart grid and check if a checkbox element is checked or not.
function CheckItems()
{
var grid=cagrid; // cagrid is the id of the componentart grid
var gridItem;
var itemIndex = 0;
var checked = false;
while(gridItem = grid.Table.GetRow(itemIndex))
{
if (gridItem.Cells[0].Value) // 0 is the 1st column as it is of checkbox type in this case
{
checked=true;
}
itemIndex++;
}
if (!checked)
{
alert(’You have not selected any items.\n Please select atleast one item.’);
}
return checked;
}
Filed under: Geek
it is very nice. it is working fine , thankyou lot….
Thank you very much. This code is more useful for me. Thanks a lot