|
Rank: Advanced Member Groups: Member
Joined: 10/21/2009 Posts: 39
|
I have a checkboxcolumn as defined below:
<eo:CheckBoxColumn Width="50" HeaderText="<input id='CheckboxDeleteAll' type='checkbox' onclick='ToggleCheckboxes()' />"></eo:CheckBoxColumn>
In the 'ToggleCheckboxes() function, how do I access all the checkboxes in the grid to select and deselect them?
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,201
|
Hi, You won't be able to access the checkboxes directly. You would access the grid cell and uses interface on the cell object to check/uncheck the checkboxes. This is necessary so that the Grid can properly update its internal data. The code will be something like this:
Code: JavaScript
var grid = eo_GetObject("Grid1");
for (var i = 0; i < grid.getItemCount(); i++)
{
var item = grid.getItem(i);
//This assumes the checkbox column is the first column
var cell = item.getCell(0);
//"1" = checked, "0" = unchecked
cell.setValue("1");
}
Thanks!
|
|
Rank: Advanced Member Groups: Member
Joined: 10/21/2009 Posts: 39
|
Great, thanks. Is there a way to get the value from the checkbox in the header?
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,201
|
Hi,
You would use regular JavaScript/DOM to access it. The checkbox in the header is not managed by the Grid thus really has nothing to do with the Grid.
Thanks!
|
|