PDA

View Full Version : XML/Datagrid - need some help...


GBScubaSteve
12-10-2006, 05:09 PM
Folks,

My first post here so - hopefully I'll find some help. ;)

I have a datagrid that is populated by loading an XML file, throwing the XML info into an array, and then datagrid.dataProvider = array. works like a charm but herein lies the problem...

The XML file is fairly simple, but there is information in that file that I do not display in the datagrid for info-overload reasons. what I want to do is allow the user to click on any row in the datagrid at which point the ADDITIONAL information is displayed below via either another datagrid (not likely) or a form-style arrangement of dynamic text fields.

just doing some playing around, i set up a listener for grid clicks to trace (myDataGrid.selectedItem) but it returns "selectedItem = [object Object]" regardless of which row is selected. No idea what that means, but then again I guess I wasn't sure WHAT it was gonna say back.

either way, can anyone provide a little guidance here? my idea is that perhaps i can add a new "index" value to the xml->array->dataProvider and then each time you click a row, it returns that "index" value. then a loop can go thru the XML and locate that index value. from there i can just pick out the extra information i need directly from the XML.

thoughts? this has been hanging me up for 3 days now. note I'm using the stock Flash 8 datagrid component.

Thanks a million in advance.:o

steve

elmedio
12-13-2006, 02:59 AM
I'm having almost the same problem...
I have two data grids with respective data sets, feeding from the same xml file, basically I want to replicate the html "anchor" effect, each time I click on the datagrid, I pass the itemIndex to the other data grid and it jumps to the values for this cell. but I haven't solved it yet because I don't know what method of the datagrid to use, and there might not be one....
For your thing you might want to check out this tutorial:
http://www.flash-db.com/Tutorials/databind/index.php
Hope it helps!