flex-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hugo Ferreira (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FLEX-33858) MenuItemRenderer in childs
Date Sun, 03 Nov 2013 16:59:17 GMT

    [ https://issues.apache.org/jira/browse/FLEX-33858?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13812418#comment-13812418
] 

Hugo Ferreira commented on FLEX-33858:
--------------------------------------

I found the solution.

The problem is that the MenuCoreItemRenderer is the responsible to create the menu childs
(sub-menus of the menu) and uses as default renderer the own MenuCoreItemRender.

In my custom menu item renderer (assuming the name MyCustomItemRenderer for this sample) that
extends MenuCoreItemRenderer I added the following code and solved the problem:

protected override function createMenu():Menu
{
	var menu:Menu = super.createMenu();
	menu.itemRenderer = new ClassFactory(MyCustomMenuItemRenderer);
	return menu;
}

Now after create the sub-menu, the code applies the custom item renderer in every child.

> MenuItemRenderer in childs
> --------------------------
>
>                 Key: FLEX-33858
>                 URL: https://issues.apache.org/jira/browse/FLEX-33858
>             Project: Apache Flex
>          Issue Type: Bug
>          Components: Spark: Menu
>    Affects Versions: Apache Flex 4.11.0
>         Environment: - MacOSX
> - AIR 3.9
> - Flash Builder 4.7
>            Reporter: Hugo Ferreira
>            Priority: Critical
>         Attachments: Menu.fxp, Menu.png, Sub-menu.png
>
>
> The menu itemrenderer works with the first level of the spark Menu but it's completly
ignored for his childs.



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Mime
View raw message