  | |  Re: [Flashnewbie] Getting the text/value of an item in a datagrid
field... | Re: [Flashnewbie] Getting the text/value of an item in a datagrid
field... 2004-02-06 - By Clint Little
Back Darron, thanks for the sample! What about if I want to get the value of the one I rolled over?
Here is what I have:
var listener:Object = new Object(); listener.itemRollOver = function(evtObj:Object){ //var col = dataGrid_grd.getColumnAt(0); trace(evtObj.index); }
So the index comes over no problem but I don't know how to translate that into the value/text I keep getting undefined no matter what I use.
Thanks,
-- Clint
On 2/6/04 4:00 PM, "Darron J. Schall" <darron@(protected)> wrote:
> A real quick example (MX 2k4): > > // my_dg is the instance name of a datagrid on the stage > _dp = []; > _dp.addItem({label:"test",somethingElse:"hello"}); > _dp.addItem({label:"test2",somethingElse:"goodbye"}); > my_dg.dataProvider = _dp; > > // whenever we click on the grid, just display what we clicked on > change = function() { > trace(my_dg.selectedItem.label); > trace(my_dg.selectedItem.somethingElse); > } > > my_dg.addEventListener("change", this); > > // -- --- > > Note the "selectedItem" property of the datagrid. That's what you want! > > -d > > -- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------ > Supported by Fig Leaf Software > -- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------ > Lower Prices for Certified Training! Check out new lower prices for > Certified Macromedia Training from Fig Leaf Software. Expand your > skill set with courses in ColdFusion, Flash, Rich Internet > Applications and .NET in the new year. Fig Leaf Software provides > the highest caliber instruction at our training centers in Washington > D.C., Atlanta, Chicago, Baltimore, Northern Virginia, or on-site at > your location. > > Get the details at http://training.figleaf.com/ > -- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -- > To unsubscribe, e-mail: flashnewbie-unsubscribe@(protected) > For additional commands, e-mail: flashnewbie-help@(protected) > >
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------ Supported by Fig Leaf Software -- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------ Lower Prices for Certified Training! Check out new lower prices for Certified Macromedia Training from Fig Leaf Software. Expand your skill set with courses in ColdFusion, Flash, Rich Internet Applications and .NET in the new year. Fig Leaf Software provides the highest caliber instruction at our training centers in Washington D.C., Atlanta, Chicago, Baltimore, Northern Virginia, or on-site at your location.
Get the details at http://training.figleaf.com/ -- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -- To unsubscribe, e-mail: flashnewbie-unsubscribe@(protected) For additional commands, e-mail: flashnewbie-help@(protected)
Earn $52 per hosting referral at Lunarpages.
|
|
 |