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:
$("body").append("<div id='d0' class='easyui-menu' style='width:120px;'></div>");
$("#d0").menu("appendItem",{text:"one"});
$("#d0").menu("appendItem",{text:"two"});
$("#d0").menu("appendItem",{text:"three"});
var item = $("#d0").menu("findItem", "three");
$("#d0").menu("appendItem", {parent: item.target, text: "three.one"});
$("#d0").menu('show');
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:
$("body").append("<div id='d0' class='easyui-menu' style='width:120px;'></div>");
$("#d0").append("<div>one</div>");
$("#d0").append("<div>two</div>");
$("#d0").append("<div><span>three</span><div style='width:150px'><div>three.one</div></div></div>");
var item = $("#d0").menu("findItem", "three");
$("#d0").menu("appendItem", {parent: item.target, text: "three.two"});
$("#d0").menu("show");
With the same result as above.
So, how can I make a menu and submenus programatically?
Thank you in advance.
Regards.