Adobe Dreamweaver Forums



Last 10 THreads :         Suddenly can't see files on remote server (Last Post : GDrink9085 - Replies : 2 - Views : 3 )           »          DW CS3 won't work on Vista Business (Last Post : Mr Bump 73 - Replies : 0 - Views : 1 )           »          mpg video will play in FF but not in IE (Last Post : Ken Binney - Replies : 1 - Views : 2 )           »          Restate my problem - YET AGAIN (Last Post : Raymond Basque - Replies : 5 - Views : 6 )           »          How to find number of occurance of each number in biglist of numbers? (Last Post : Dan Bracuk - Replies : 3 - Views : 6 )           »          files are one level too deep (Last Post : Alan - Replies : 6 - Views : 7 )           »          Moving custom tag registration between servers. (Last Post : nosredna - Replies : 0 - Views : 1 )           »          How to do this?. (Last Post : Dan Bracuk - Replies : 1 - Views : 2 )           »          Spry Menu Background (Last Post : ich_kann_schnell_laufen - Replies : 0 - Views : 1 )           »          Dreamweaver CS4 makes my fonts go mental? (Last Post : theRizzer - Replies : 3 - Views : 9 )           »         


Home Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
User Info Statistics
Go Back   Adobe Dreamweaver Forums > Other Macromedia/Adobe Products > Flex
 
Tags:



Reply
  #1 (permalink)  
Old 07-09-2008, 01:20 AM
Joey-ATL
 
Posts: n/a
Diggs:
Default Am I missing something here?

I am trying to follow the many tutorials on getting data from a DataGrid cell
and what has me stopped dead in my tracks is this line:

[Q]tempValue = mydatagrid.dataProvider.getItemAt(row)[field];[/Q]

When I show the available options they are the options for the Object class
not ArrayCollection class.

I wonder if I am mixing Flash with Flex. If so, how do you grab the value in
a DataGrid with Flex?

Thanks In Advance.



Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 07-09-2008, 01:20 AM
dpark1113
 
Posts: n/a
Diggs:
Default Re: Am I missing something here?

try,
mydatagrid.dataProvider.getItemAt(row).field
Reply With Quote
  #3 (permalink)  
Old 07-09-2008, 01:20 AM
Joey-ATL
 
Posts: n/a
Diggs:
Default Re: Am I missing something here?

I don't think I made myself clear, after I type "mydatagrid.dataProvider." the only options are those for a plain Object class not an ArrayCollection class. so I never see a getItemAt(.... option.
Reply With Quote


  #4 (permalink)  
Old 07-09-2008, 01:20 AM
Joey-ATL
 
Posts: n/a
Diggs:
Default Re: Am I missing something here?

I found a workaround, but still wondering what was my problem above?

Here is how i am doing it now.

[Q]var ac:ArrayCollection = dg.dataProvider as ArrayCollection;
Alert.show( ac.getItemAt(rownumber)[field] );[/Q]

Reply With Quote
  #5 (permalink)  
Old 07-09-2008, 01:20 AM
dimival
 
Posts: n/a
Diggs:
Default Re: Am I missing something here?

I wouldn't say it is a workaround, it is the correct way of doing it.

On the documentation it is very clear, dataProvider is typed as Object, so
whenever you read this property you will get an Object no matter if it really
an array, arraycollection or an xml


http://livedocs.adobe.com/flex/201/l.../ListBase.html
#dataProvider

It is important to be aware of the data types of each property, so you can
cast it and use it properly.

Reply With Quote
  #6 (permalink)  
Old 07-09-2008, 03:50 PM
Joey-ATL
 
Posts: n/a
Diggs:
Default Re: Am I missing something here?

You're right. I appreciate your help!

Thanks
Reply With Quote


Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



© Camley Interactive (camley.info) 2008 - all logos and images are copywrite their respective owners.
Proud member of the Camley Interactive Network
All times are GMT. The time now is 08:11 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
Inactive Reminders By Mished.co.uk