ComponentArt Grid - loop thru grid using javascript

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;
}

2 Responses to “ComponentArt Grid - loop thru grid using javascript”

  1. it is very nice. it is working fine , thankyou lot….

  2. Thank you very much. This code is more useful for me. Thanks a lot

Leave a Reply