PDA

View Full Version : How to : get/set grid' s cell value while clicked grid cell?



skyey
20 May 2007, 6:47 AM
grid.addListener('cellclick',app.gridRowClick);


gridRowClick: function(grid, rowIndex,columnIndex,e){
e.stopEvent();
if(columnIndex!=0){
//alert('you click ('+rowIndex+","+columnIndex+")");
here , how to get/set cell value?
}

}

jsakalos
20 May 2007, 8:57 AM
Set the value of a field of grid store's record.

skyey
20 May 2007, 9:05 AM
hi jsakalos, i already showed record in the grid.i want to click the grid's cell and show me the value


gridRowClick: function(grid, rowIndex,columnIndex,e){
e.stopEvent();
if(columnIndex!=0){
//alert('you click ('+rowIndex+","+columnIndex+")");
here , i want to alert cell value?
}

}

jsakalos
20 May 2007, 9:07 AM
Again, you have to get the value from store instead of grid. Grid only displays. Real data is in the store.

skyey
20 May 2007, 9:13 AM
but the cell is a image, i want to show another image while clicked it

jsakalos
20 May 2007, 10:15 AM
Hmm,
I have no clue what are you trying to do





if(columnIndex!=0){
//alert('you click ('+rowIndex+","+columnIndex+")");
here , i want to alert cell value?
}
You cannot alert image. How have you stored image in the store anyway?

Generally, you get/set values from/to store. If you want any special display/processing you have to write custom renderer/event handler.