Title: menu and submenu Post by: evaj on September 14, 2012, 11:26:36 AM Hi!
This is my first post. I'm working with jquery and easyui and I have a doubt. I want to create a menu and submenu from javascript. This is my source code: Code: $("body").append("<div id='d0' class='easyui-menu' style='width:120px;'></div>"); However the submenu is not showed when I put the cursor on item "three". Also I tried to create a menu with html sentences in jquery: Code: $("body").append("<div id='d0' class='easyui-menu' style='width:120px;'></div>"); With the same result as above. So, how can I make a menu and submenus programatically? Thank you in advance. Regards. Title: Re: menu and submenu Post by: stworthy on September 14, 2012, 06:11:25 PM Calling 'appendItem' method to append sub menu to an empty parent menu is invalid in current version. Your second code fragment is missing a statement to create the menu. Try this code:
Code: $("body").append("<div id='d0' class='easyui-menu' style='width:120px;'></div>"); Title: Re: menu and submenu Post by: evaj on September 15, 2012, 12:43:29 AM Hi
I'm very delighted with your solution. Only one line of code and the menu and submenu is working as I expected. Thank you very much. |