List Info

Thread: Deep Menu's With Menu Button ??




Deep Menu's With Menu Button ??
country flaguser name
United States
2007-10-24 12:28:27

Hello, please how can I create a yui button of type "menu" that has a
menu in which on of the menu items has another submenu.

I tried this :
// product menu controls
var productsMenu = [
{text:"add product"},
{text:"edit product", submenu : [
{text:"edit product data"},
{text:"edit product views";},
{text:"edit product Dirs.";}
]
},
{text:"delete product", value:"deleteproduct"}
];
var productTool = new YAHOO.widget.Button({
type : "menu",
label : "Products",

id : "addProductTool",
container : "toolbar",
menu : productsMenu });

an arrow shows beside the edit product menuitem but no sub menu is
displayed when the mouse is over it.

How can I add a submenu to a menuitem of the menu button.

Thanks
Charles Odili,
University of Benin,
Nigeria.

__._,_.___
.

__,_._,___
Re: Deep Menu's With Menu Button ??
country flaguser name
United States
2007-10-24 14:23:48

Charles -

You are not creating the submenu correctly. The "submenu" configuration
property doesn't accept an array. Here is a link to the docs for the
"submenu"; configuration property:

http://developer.yahoo.com/yui/docs/YAHOO.widget.MenuItem.html#submenu

Here is a working example:

http://yuiblog.com/sandbox/yui/v231/examples/button/menubutton_width_submenu.html

- Todd

chaluwa wrote:
>
> Hello, please how can I create a yui button of type "menu" that has a
> menu in which on of the menu items has another submenu.
>
>; I tried this :
> // product menu controls
> var productsMenu = [
> {text:"add product"},
>; {text:"edit product", submenu : [
> {text:"edit product data"},
> {text:"edit product views";},
> {text:"edit product Dirs.";}
> ]
> },
> {text:"delete product", value:"deleteproduct"}
> ];
> var productTool = new YAHOO.widget.Button({
> type : "menu",
> label : "Products",
>
> id : "addProductTool",
> container : "toolbar",
> menu : productsMenu });
>
> an arrow shows beside the edit product menuitem but no sub menu is
> displayed when the mouse is over it.
>
> How can I add a submenu to a menuitem of the menu button.
>
> Thanks
> Charles Odili,
> University of Benin,
> Nigeria.
>
>;

__._,_.___
.

__,_._,___
[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )