Link to home
Start Free TrialLog in
Avatar of newbieal
newbiealFlag for United States of America

asked on

Flex 3 Datagrid: pop-up window when cell is selected

I have a flex datagrid to which I need to add this functionality: user clicks on cell, window should pop-up with additional information about the value in that cell.  The pop-up might need to be another datagrid with more info.

The data source for the main datagrid is xml.  Thanks for any help!
SOLUTION
Avatar of Fuzzy_Logic_
Fuzzy_Logic_
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of newbieal

ASKER

Thanks!  This is a great start, however the itemContents should be populated with additional data from my xml file.  If user clicks on a cell with content of 'A'.  Then I need to display additional info from my xml file that relates to content 'A'.

Also, the example only displays info when clicked within cells of the first column.  My datagrid has several more columns.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks, Fuzzy Logic.

I implemented the code and nothing displayed.  Then I did some line by line debugging and have noticed that this line:

var detailContents:XMLList = itemContents.data;

produces a null value.  I noticed that the 'data' part is not part of the normal 'itemContents' library.  What should I put in place of this 'data' value?

I changed that line to:

var detailContents.XMLList = itemContents.children();

It produces the data I want, however it is displayed in XML format to the user.  How can I change the format?
sorry, ignore my last comment reg. the change...it didn't not do what I wanted it.
I'm not sure why this isn't working for you. Seems to work just fine here :-~

itemContents.data refers to the extra nodes that I have added to the example which map the parent nodes giving easy access to sub data for each cell

itemContents is just a variable to hold the selected row and thus the XML.

itemContents.children will just give you the XMLList of all the nodes.

itemContents.data refers to the node <data> and using the columnIndex we can access the children of the <data> node.

It depends really how you have structured your XML file as to how you access sub data.



Have you made any progress with this?
A little bit in that it displays the relevant row info when I click on a cell, but it displays it in xml format.  I want to present it in a way that is user friendly.  I'm struggling with that aspect.
If you like show me the xml that you are getting in the display and then I'll show you how to make it more readable.
It's just like any xml file data.  Here is an example (actual data is much longer, but I think you get the gist):

<Data>
<CellData> 1 </CellData>
</Data>
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks for all your help.  You've definitely lead me into the right direction.