What events fire for the Checkbox Template in a Grid?
I'm attempting to use an AW.Templates.Checkbox in a Grid. I cannot get any events to fire from the Templates.
None of these fire when a checkbox is clicked.
The only way I have found to attach to an event from checking the checkbox is to use:
This is not sufficient, though, because obj.onCellValueChanged is called when the data is being loaded into the grid, not only when someone has just clicked on the Checkbox. Also, since this event is attached to the Grid, and not a specific Template or column, it fires when any cell value changes, not just when a Checkbox is clicked.
I use obj.onCellValidated to invoke my save method, and that event does not fire when a checkbox is clicked.
This is driving me nuts, any advice or help is appreciated.
<script>
var myData = [
[false,true],
[true,false],
];
var myColumns = [
"CB 1", "CB 2"
];
var obj = new AW.Grid.Extended;
var cbx = new AW.Templates.Checkbox;
cbx.onControlValueChanged = function(){alert("onControlValueChanged")};
cbx.onCellValueChanged = function(){alert("onCellValueChanged")};
cbx.onCellValidated = function(){alert("onCellValidated")};
cbx.onControlClicked = function(){alert("onControlClicked")};
cbx.onClick = function(){alert("onClick")};
obj.setCellTemplate(cbx,0);
obj.setCellTemplate(cbx,1);
obj.setCellText(myData);
obj.setHeaderText(myColumns);
obj.setRowCount(2);
obj.setColumnCount(2);
obj.setSelectorVisible(false);
obj.setSelectorWidth(28);
obj.setHeaderHeight(20);
obj.setCellEditable(true);
obj.setVirtualMode(false);
document.write(obj);
</script>
None of these fire when a checkbox is clicked.
The only way I have found to attach to an event from checking the checkbox is to use:
obj.onCellValueChanged = function(){alert("obj.onCellValueChanged")};
This is not sufficient, though, because obj.onCellValueChanged is called when the data is being loaded into the grid, not only when someone has just clicked on the Checkbox. Also, since this event is attached to the Grid, and not a specific Template or column, it fires when any cell value changes, not just when a Checkbox is clicked.
I use obj.onCellValidated to invoke my save method, and that event does not fire when a checkbox is clicked.
This is driving me nuts, any advice or help is appreciated.
John
January 12,