JScript to Check or Uncheck Checkbox in a Grid
Inputs:
GridObject: Object of the grid in which checkbox exists
Column: Column name where value is searched
CellValue: Reference cell value
Status: Check or uncheck the checkbox
function CheckUncheckCheckbox(GridObject, Column, CellValue, Status)
{
// Column Index
var ColumnIndex = GetColumnIndex(GridObject,Column);
// Row index
var RowIndex = GetRowIndex(GridObject, Column, CellValue);
// Row node
var RowNode = Grid.m_Nodes.get(RowIndex);
// Current Checkbox state
var currentStatus = RowNode.getChecked();
if(currentStatus == status)
{
Log.Message("Checkbox is already "+(Status?"checked":"unchecked"));
}
else
{
GridObject.doCheck(RowNode);
Log.Message("Successfully "+(Status?"checked":"unchecked"));
}
}
0 Comment(s)