title: how to retrieve the value from grid cell in GXT
body: <p>I have created a editable grid with only 3 of its columns out of 5 as editable. I'm not getting how to retrieve values from the particular cells, so that the values can be dynamically added and displayed inside another cell of same grid. I've tried this code in eclipse galileo. But its not working. Please help me.</p>
  
  <pre><code>package org.openxdata.analyzer.client;
  
  import java.util.ArrayList;
  import com.extjs.gxt.ui.client.widget.grid.ColumnConfig;  
  import com.google.gwt.user.client.Element;
  import com.extjs.gxt.ui.client.widget.grid.ColumnModel;  
  import com.extjs.gxt.ui.client.Style.HorizontalAlignment;  
  import java.util.List;
  import com.extjs.gxt.ui.client.store.ListStore;
  import com.extjs.gxt.ui.client.widget.MessageBox;
  import com.extjs.gxt.ui.client.widget.Window;
  import com.extjs.gxt.ui.client.widget.button.Button;
  import com.extjs.gxt.ui.client.widget.form.TextField;  
  import com.extjs.gxt.ui.client.widget.grid.CellEditor;  
  import com.extjs.gxt.ui.client.widget.grid.EditorGrid;  
  import com.extjs.gxt.ui.client.widget.layout.FitLayout;  
  import com.extjs.gxt.ui.client.widget.layout.FormData;
  import com.extjs.gxt.ui.client.data.BaseModel;
  import com.extjs.gxt.ui.client.event.ButtonEvent;
  import com.extjs.gxt.ui.client.event.SelectionListener;
  import com.extjs.gxt.ui.client.widget.Viewport;
  import com.extjs.gxt.ui.client.widget.form.NumberField;
  
  
  public class Grid1 extends Viewport {
  
      @Override
      protected void onRender(Element parent, int index) {
          super.onRender(parent, index);
          setStyleAttribute("margin", "10px");
  
  
  
          final Window w = new Window();
          w.setHeading("grids");
          w.setSize(600,250);
          w.setModal(true);
          //w.setLayout(new RowLayout(Orientation.VERTICAL)); 
          w.setLayout(new FitLayout());
          w.setResizable(false);
  
          FormData formData = new FormData("98%");
  
  
          List&lt;ColumnConfig&gt; col = new ArrayList&lt;ColumnConfig&gt;();
          ColumnConfig column = new ColumnConfig();
          column.setId("disease");
          column.setWidth(150);
          TextField&lt;String&gt; text = new TextField&lt;String&gt;();    
          text.setAllowBlank(false);    
          text.setAutoValidate(true);    
          //column.setEditor(new CellEditor(text));  
          col.add(column);
  
  
          column = new ColumnConfig();
          column.setId("exposure");
          column.setWidth(120);
          TextField&lt;String&gt; text1 = new TextField&lt;String&gt;();    
          text1.setAllowBlank(false);    
          text1.setAutoValidate(true);    
          //column.setEditor(new CellEditor(text1));  
          col.add(column);
  
          column = new ColumnConfig();
          column.setId("plus");
          column.setHeader("Exposure");
          column.setWidth(80);
      final NumberField text2 = new NumberField();    
          text2.setAllowBlank(false);    
          text2.setAutoValidate(true);    
          column.setEditor(new CellEditor(text2));  
          col.add(column);
  
          column = new ColumnConfig();
          column.setId("minus");
          column.setHeader("Exposure");
          column.setWidth(80);
          final NumberField text3 = new NumberField();   
          text3.setAllowBlank(false);    
          text3.setAutoValidate(true);    
          column.setEditor(new CellEditor(text3));  
          col.add(column);
  
          column = new ColumnConfig();
          column.setId("total");
          column.setHeader("Totals");
          column.setWidth(80);
          final NumberField text4 = new NumberField();      
          text4.setAllowBlank(false);    
          text4.setAutoValidate(true);    
          column.setEditor(new CellEditor(text4));  
          column.setAlignment(HorizontalAlignment.RIGHT);
          col.add(column);
          //ColumnModel cm = new ColumnModel(col);
  
          ListStore&lt;Grid2&gt; employeeList = new ListStore&lt;Grid2&gt;();    
          employeeList.add(cool.getgrid());
  
  
          ColumnModel cm = new ColumnModel(col);  
  
  
          final EditorGrid&lt;Grid2&gt; grid = new EditorGrid&lt;Grid2&gt;(employeeList, cm);  
          //grid.setStyleAttribute("borderTop", "none");  
          //grid.setAutoExpandColumn("name");  
          grid.setBorders(true);  
          grid.setStripeRows(true);  
            Button calculate = new Button("Calculate");
              w.addButton(calculate);
  
  
  
              calculate.addSelectionListener( new SelectionListener&lt;ButtonEvent&gt;()
  
                      {
  
  
                   @Override  
                      public void componentSelected(ButtonEvent ce) {  
                      {   
  
                          Double   p=(Double)text2.getValue();
                          Double m=(Double)text3.getValue();
  
  
                          Double t=p+m;
  
                          text4.setValue(t);
  
                          }  
                   }
  
                      });
  
  
  
          w.add(grid);
          w.show();
      }
  }
  
  
  class Grid2 extends BaseModel {
      private static final long serialVersionUID = 1L;
      public Grid2(){
      }
      public Grid2  ( String  dis, String exp, Integer x,Integer y) {
          set("disease", dis);
          set("exposure", exp);
          set("plus", x);
          set("minus", y);
      }
  
      public Grid2 (String  dis, String exp, Integer x,
              Integer y, Double v) {
          // this(dis, exp, x,y,v);
          set("disease", dis);
          set("exposure", exp);
          set("plus", x);
          set("minus", y);
          set("total", v);
      }
      public Grid2(String a,String b,String c,String d,String t){
          set("disease",a);
          set("exposure",b);
          set("plus",c);
          set("minus",d);
          set("total",t);
      }
      public  Integer getplus() {
          return (Integer)get("plus");
      }
      public Integer getminus() {
          return (Integer)get("minus");
      }
  
  
      public class TestData {  
  
          public  List&lt;Grid2&gt; getData()  
          {  
              List&lt;Grid2&gt; lt= new ArrayList&lt;Grid2&gt;();  
  
  
  
              lt.add(new Grid2("Christina Blake","Information Technology",1,2,1.23));  
              lt.add(new Grid2("Heriberto Rush","Information Technology",3,4,1.334));  
  
              return lt;  
          }  
      }  
  
  }
  
  class cool {  
  
      public static  List&lt;Grid2&gt; getgrid()  
      {  
          List&lt;Grid2&gt; data = new ArrayList&lt;Grid2&gt;();  
  
          //data.add(new Grid(" "," ","Exposure"," ","Totals"));  
          data.add(new Grid2(" "," ","(+)","(-)"," "));  
          data.add(new Grid2("'Disease'","(+)",0,0,0.00));  
          data.add(new Grid2(" ","(-)",0,0,0.00));  
          data.add(new Grid2("Totals"," ",0,0,0.00));  
  
  
          return data;  
      }  
  
  }
  </code></pre>