Get a cells value 2004-04-15 - By Cristiano Monteiro dos Santos
Back 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/
|
|