View Full Version : DataGrid cell value
cfilipepl
05-05-2005, 04:18 PM
Does anyone know how to get a cell value in the DataGrid component?
mygrid.getItemAt(rowIndex)[columnIndex] it's not working despite the fact I have configured its storage type to be an array...
Does anyone know how to do that?
Thanks in advance.
Carlos
Eightball8018
05-20-2005, 03:28 PM
if you want to change the data in the dataprovider, its as follows :
myDataGrid_dg.dataProvider.editField (_indexNumber_, "_columnName_", _newData_);
ie. myDataGrid_dg.dataProvider.editField(0, "quantity", 34);
or.. if you are trying to retrieve data from a certain cell :
myDataGrid_dg.dataProvider.getEditingData(_indexNu mber_. "_columnName_");
Hope this is what you were looking for.
Al Ridley
Odyssey Innovations
aridley@odysseyinnovations.net
jumpingJack
12-27-2005, 09:22 PM
This post just helped me big time. Thanks (see some people do search :)
dasqrd
02-09-2006, 01:38 AM
I tried your suggestion...
Both mygrid.getItemAt(rowIndex)[columnIndex] and
myDataGrid_dg.dataProvider.getEditingData(_indexNu mber_. "_columnName_").
They are not working for me...
Could you please help?
Thanks in advance
Chris :smash:
jumpingJack
02-09-2006, 12:23 PM
Perhaps this example will help. I wanted to launch a PDF when the user pressed a particular grid cell. This is what I used:
//-------------------------
var myCellPressListener = new Object();
myCellPressListener.cellPress = function(event) {
var cell = "(" + event.columnIndex + ", " + event.itemIndex + ")";
trace("The cell at " + cell + " has been clicked");
pdfFilePath = "./" + _root["myDocumentURL" + event.itemIndex];
if (event.columnIndex == 4) {
getURL(pdfFilePath);
}
};
myDataGrid.addEventListener("cellPress", myCellPressListener);
//-----------------
So, basically, I could tell which row was pressed, but I had to determine which column was pressed immediately afterward.
dasqrd
02-09-2006, 02:06 PM
Thanks jumpingJack. :good:
I got it to work now...
vBulletin v3.5, Copyright ©2000-2010, Jelsoft Enterprises Ltd.