getting and setting cfgrid cell value
in cf9 i have a bound cfgrid with an ID (numerical) column and a checkbox column. onChange calls a js function where i have a list of numbers (corresponding to some of the ID's in the ID column). i want to loop through both my list and the ID column of the grid, and, if a match, set the corresponding checkbox to "checked". i can't figure out the correct syntax. i've marked with ??? the stuff i'm having problems with
any help appreciated
var mygrid=ColdFusion.Grid.getGridObject("aGrid"); // get number of rows in grid
var mydata = mygrid.getStore();
var rowCount = mydata.totalLength;
var i = 0;
var myList = "2,4";
var myArr = myList.split( "," ); // convert list to array
while ( i < myArr.length) // loop through list array
{
for (var r = 0; r < rowCount; r++) // loop through grid rows
{
// get the id value corresponding to the r row - throws error "exception thrown and not caught"
??? var thisID = ColdFusion.getElementValue('aGrid', 'aForm', 'app_id
if (myArr == thisID)
{
// set the status of the corresponding checkbox to "checked" - no idea how to do this
??? ColdFusion.setElementValue('aGrid', 'myCheckboxColumn
}
}
}
