PDA

View Full Version : [AS3] 3 questions on datagrid-xml


marmite
08-04-2009, 04:09 PM
I'm making an interactive table - using a datagrid to show xml data - e.g unemployment figures. Users should be able to add and remove columns and filter by year and country.

1) does anyone have sample code of something similar?

2) Should the page load the xml just once, on the user's first visit, and then keep the data in an array? Or should the page reload the xml each time? If reloading, should Flash $_POST variables to the xml (it's currently "select *...")? Any sample code?

3) I'm using the below to add four fixed rows to the grid. But I need to alter the number, order and name of columns on the fly. Is it best to use an object or an array for this? Any sample code?

dp.addItem({ctry:xmlData.record.ctry[i], year:xmlData.record.year[i], emp:Math.round(xmlData.record.emp[i]), unemp:Math.round(xmlData.record.unemp[i]) });

Thanks for any help. I have some PHP/SQL/AS2 knowledge but am struggling with As3.

Emma