:: Forum >>

calling a javascript function on clicking the checkbox in a grid.

I have a check box corresponding to each row in my grid.When tht check box is selected/clicked i want to call a java script function.How can i do that?
Pls help.
LK
Tuesday, March 28, 2006
Well.. it depends on whether you're using AW.Templates.Checkbox as cell's template or regular HTML checkboxes..

If you're using AW.Templates.Checkbox, then do the folowing:

myGrid.onCellValueChanging = function(value, col, row) {

/*
Do your stuff here...
Return any non-zero value to stop the clicking event (ie. return "disable")
*/


};


If you're filling the column with regular checkboxes, then you've got 2 options.. either set onCellClicked event, or setup a native onclick handler on the checkbox... Setting the onCellClicked will fire the event even if the user clicks cell's whitespaces surrounding checkboxes (if any), while the latter will only fire on the checkbox itself...

Something like that..
[ ]'s
Diego Vilar
Tuesday, March 28, 2006
Diego thks for ur reply.
I am using a turbo grid and in my data model to make the grid i am defining the check box column like this.
columns = [
{ name: 'id',width: 50},
[ turbo.grid.columns.bool,{ name: 'Remove', width: 50 }]
];
this is to make a grid containing 2 columns (2nd one is the check box column).
I am passing this data model as an argument to the turbo grid controller.
now how can i call a js function on clicking the check box?
Hope u understood the problem
Pls reply.
LK
Tuesday, March 28, 2006
Dude, I'm sorry, I know nothing about turbo grid and their events... What does that has to do with AW? Try http://turboajax.com/turbowidgets/grid/documentation/index.html or http://www.turboajax.com/forum/ ... makes more sense...

[ ]'s
Diego Vilar
Wednesday, March 29, 2006
And here is AW example on using checkboxes for row selection -

http://www.activewidgets.com/grid.howto.selections/selecting-rows-with-checkboxes.html

:-)
Alex (ActiveWidgets)
Wednesday, March 29, 2006

This topic is archived.


Back to support forum

Forum search