i would like to create a very interactive analysis and would be grateful if someone would push me in the right direction to go as i am very new to flex. (though not new to programming generally).
How it should work:
i have a small php-script which will output the complete list of entries as XML.
putting that in a grid is easy
i need sumcolumns (not rows!) and some additional calculations (nothing fancy, just some multiplying of the sum of two columns with a value)
now i want to give the user a list of the columns of that list. if he clicks on entries only the selected columns and the sumcolumn remain and the query is "grouped by" those columns.
now i could easily do that by asking for the resulting list from the server every time. but of course that's not what i expect to do in an ajax-application. If i understood correctly i won't be able to filter and group easily in the xml-list itself, so i would have to put it in an ArrayCollection? will that enable me to add and calculate the additional columns and do a group-by-summing?
It doesn't seem to be powerful enough for that. is there something better? or do i ask the server everytime?
I would create a bindable ValueObject, and in the result handler, loop over the xmllist and build an arraycollection of VOs. The VO would have proerties and methods for any calculated columns, which could be calculated when created or on demand depending. This would let your sort and group on the calculated columns. You can use a labelFunction for display, but still get valid sorting on the underlying data.
Also, look into HierarchicalData and the AdvancedDataGrid.