Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Purushottam Dwivedi on Nov 16, 2008 21:33
open dhtmlx forum
Dhtml Grid How to handle the cell event Its Very Urgent !!!!!!!!!!!!

Hi,

i have a grid which have 3 coloum . i want to handle the cell event of the grid.

for example

first row of the first cell has value 'Taj Hotel'
first row of the second cell has value 5
first row of the third cell has value 6

i want to show the secondcell value * third cell value in fourth celll

if i change the value of the third cell then the fourth cell value is autmatically chage

Thank you
Answer posted by Support on Nov 17, 2008 03:37
mygrid.attachEvent("onEditCell",function(stage,id,ind,value){
   if (stage == 2 && ind == 2  )
       mygrid.cells(id,3).setValue(mygrid.cells(id,1).getValue()*mygrid.cells(id,2).getValue());
   return true;
});

by the way - grid supports math operations, which can be used instead of manual event handling
http://dhtmlx.com/docs/products/dhtmlxGrid/samples/rows_columns_manipulations/pro_math.html?un=1226923299000