Mailing List
Home
Forum Home
Flash Pro
Subjects
Firework Effect
setInterval bug identified and fixed
setInterval bug identified and fixed
ScrollPane component doesn 't auto update
Help: MX 2004 How to script a print button to print the entire sli
Event Dispatcher between classes
memory management removeMovieClip /
MX2004 Dataset itemClassName
Order of events per frame
XML to Object help
Textfield prototype question
Flash and QuickTime VR
Reading and displaying RSS feeds in Flash MX
Flash MX 2004 Sucks
AW: [Flashcoders] Switch/Case vs If/else
AW: [Flashcoders] Switch/Case vs If/else
Flash Interface with 10mb xml file
Web Service Results
Listener Object 's best practice
 
Get a cells value

Get a cells value

2004-04-15       - By Cristiano Monteiro dos Santos

 Back
Reply:     1     2  

Me again!

I'm working with the DataGrid component for dealing with search results and
stuff like that. I need to know how can I get the value of the cell the user
just clicked. I'm working with the event cellPress of that component and I have
made some progress... Bellow is the (poor) code I made:

//-- ---- ---- ---- ---- ---- ---- ----
dgTest.columnNames = ["column1", "column2", "column3"];

var mySource = new Array();

mySource[0] = {column1:"1asdfas", column1:"2jsd 67w"};
mySource[1] = {column3:"asdfasdf asdf sa"};

dgTest.dataProvider = mySource;

clickListener = new Object();
clickListener.cellPress = function( myEvent ) {
  trace( "columnIndex/itemIndex: " + myEvent.columnIndex + "/" + myEvent
.itemIndex );
  trace( dgTest.getItemAt( myEvent.itemIndex )[myEvent.columnIndex] );
}

dgTest.addEventListener( "cellPress", clickListener );
//-- ---- ---- ---- ---- ---- ---- ----

The second trace is the one I'm interested in, but it's not working. How am I
supposed to recover the value of the clicked cell?

TIA!
-cris


-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
Server geeks, take heart! If you're sick of wading through
animation & graphics instruction for relevant info., then
Nate Weiss' Macromedia Flash MX Professional 2004 for Server
Geeks is for you. Leave designing to designers and dig into
core concepts to create rich user interfaces, online
advertising, and more.  See www.peachpit.com for more info.
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/FLASHmacromedia/

<*> To unsubscribe from this group, send an email to:
    FLASHmacromedia-unsubscribe@(protected)

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/