Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by shaffi baig on May 18, 2009 05:59
open dhtmlx forum
HOW USE onclick method in radio button of grid

Hi,

i need to know how to add radio button to the grid in html table.my requirement is like this.

<html>
<table>
<c:forEach....>
<tr><td><input type="radio" value="ss" onclick="some(2,eee,ttt)"/></td></tr>
</c:forEach>
</table>
</html>

Like above html table i need to implement grid in html table...i know how to use grid in html table..but i don't know how to use onclik mehtod in grid radio button and how to pass parameter which are dynamically assigned to the onclick method during the iterations...please help me ...after doing every thing ..i struck with this...please help needed very urgent..
Answer posted by Alex (support) on May 18, 2009 07:40

Grid provides a ready "ra" excell. Just set the column type and the necessary attributes:

<table name="grid" oninit="doOnInit()" class="dhtmlxGrid" imgpath="../../codebase/imgs/" style="width:400px" >
  <tr>
  <td type="ra">Column N</td>
  </tr>
 <c:forEach....> 
<tr attr1=".." attr2=".." ...><td ></td></tr> 
</c:forEach>

</table>

function doOnInit(){

grid.attachEvent("onEditCell",function(stage,id,index){ /*this event wil be called when cell is edited (radio is clicked)*/

if(stage==1) some(grid.getAttribute(id,"attr1"),grid.getAttribute(id,"attr2"),...);

return true

})

}