I've used prana for many tricky things before (I'll have to post some of my more recent cleverness from my prana / puremvc experiences) - but one thing I'm facing now is this:
I've got a a datagrid that has columns that are defined by data at runtime, and these columns have an item renderer / editor that is defined by additional data at runtime. (For instance, a given datagrid could be loaded with columns representing geographic regions and a time-period column - and if a dataset has 5 regions - there would be 5 columns of regions and 1 column showing a date range or something) - now each of these columns needs to have a combobox or some data-driven control to make selections for that region... (lets say it's for scheduling)
So I have a simple method that I created to make it easier to get my columns set up:
The method that this one calls into is where I am trying to figure out if I can leverage Prana (or Spring AS3 now) / pureMVC to help me out:Code:public function get dataGridColumns():Array { var columns:ArrayCollection = new ArrayCollection(); // time period column is created in another method - but // it is just a simple column that defines how to render the time // data columns.addItem(timePeriodColumn); if (region != null && region.length > 0) { // iterate over all the the regions add columns for each of them for each (var s:Object in region) { var column:DataGridColumn = getRegionColumn(s as RegionVO); columns.addItem(column); } } return columns.source; }
The ClassFactory works ok - but what it doesn't do well is it doesn't provide my a way to cleanly tell the renderer where to get the data to populate the combobox from.Code:protected function getSitegroupColumn(site:SiteGroupVO):DataGridColumn { var c:DataGridColumn = new DataGridColumn(site.name); c.itemRenderer = new ClassFactory(scheduledItemRenderer); (c.itemRenderer as ClassFactory).properties = {region: Region}; c.sortable = false; return c; }
Does Prana have an easy utility to specify a config name and have it return a ClassFactory so I could create a prototype object in the config file and then have Prana be responsible for returning it? I'd much rather do my dirty work in Prana (or Spring now, sorry) than relying on ClassFactory.
Ryan
PS: Christophe - I never signed / sent in those papers... woops. PM me and tell me what I need to do to get those to you![]()


Reply With Quote