Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted on Nov 09, 2009 02:24
open dhtmlx forum
dhtmlxGrid having radiobuttons

I have a dhtmlxGrid . I have loaded a xml file inside it. I have 3 columns in the grid. My second column consists of radiobuttons. On selection of any of the radio button I want a event to occur. How do I do it. Please provide an example.

Answer posted by Alex (support) on Nov 09, 2009 04:50

Do you use "ra" column type?

In this case you can use onEditCell event to listen to state of the editor. The state (editor value) can be got by getValue method:

grid.attachEvent("onEditCell",function(stage,rowId,cellIndex){
  if(stage==1){
  var value = this.cells(rowId,cellIndex).getValue();
  /*some your code here*/
  }
  return true
})



Answer posted by Stanislav (support) on Nov 09, 2009 04:52
Also, you can use "onCheck" event

grid.attachEvent("onCheck",function(id,index,state){
     //will be called each time after radio checking
     ... any custom code here ...
})