Title: Where to put ItemRenderers? Post by: justSteve on March 31, 2008, 03:19:43 Just finished reading Peter Ent's itemRenderers: Part 4: States and Transitions (http://weblogs.macromedia.com/pent/) outlining a really clear way to handle a lot of what my menus' buttons have to deal with - state and showing or hiding other elements depending on that state.
But the renderer as presented in that specific demo seems impossible to implement in Purely MVC fashion. Is it a matter of breaking the different code elements to respective roles? As presented it's soooo nice and tidy. Do we have itemRenderers exhibited in any demos? thx --steve... Title: Re: Where to put ItemRenderers? Post by: puremvc on March 31, 2008, 11:58:25 Hi Steve,
What problems are you having specifically? I have one on the back burner. But what problems specifically are you having? Aside from the normal fact that item renders stink in Flex? -=Cliff> Title: Re: Where to put ItemRenderers? Post by: justSteve on April 01, 2008, 03:51:27 The problem is getting my head around the division of labors involved. A view looks to a controller for it's info but it looks as though in Ent's code the view (dataitemRenderer) is poking directly into the model.
>> The set data function determines which state to use by looking at the value of instock: override public function set data( value:Object ) : void { super.data = value; if( data ) { if( data.instock == "yes" ) currentState = ""; else currentState = "NoStockState"; } } >> Title: Re: Where to put ItemRenderers? Post by: puremvc on April 02, 2008, 07:50:33 In the item renderer, 'data' is the property of the specific data being rendered. This comes from the view component (DataGrid, List, etc) it is rendering an item for.
Here's a scenario to clear things up:
Hope this helps, -=Cliff> Title: Re: Where to put ItemRenderers? Post by: justSteve on April 02, 2008, 08:01:23 I does help...thankx much.
|