Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Displaying a popup of info from a datagrid 1

Status
Not open for further replies.

mattquantic

Programmer
Mar 28, 2004
196
GB
Hi. I have a datagrid component with some rows of information in it.

Any of the rows can be clicked. What I'd like to do is transfer the data from the row that is clicked to structure, so that I can display it somewhere (where things like multiple lines of text can be viewed).

Does anyone know if there is a function to do this, or what the syntax is to listen for the click and access the data from the selected row.

Thanks if you can enlighten.

M@)
 
Say you have a DataGrid called "dg":

[tt]//
var listenerObject:Object = new Object();
dg.addEventListener("cellPress", listenerObject);
listenerObject.cellPress = function(eventObject:Object):Void {
var index:Number = eventObject.itemIndex;
var o:Object = dg.getItemAt(index);
for (var s in o) {
trace(s+": "+o); // or do something useful
}
};
//[/tt]

Kenneth Kawamoto
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top