With Easy-ui accordion, the parent container is not adaptive when it is automatically generated with JSON. The code is as follows:
(document). Ready (function () {
$.ajax ({
Type: ' POST ',
DataType: "JSON",
URL: ' Getmenu.action ',
Success:function (data) {
$.each (Data,function (I,item) {
$ (' #menu '). Accordion (' add ', {
Title:item.menu_name,
Content: ' Sky Dragon Ride ',
ICONCLS: "Icon-ok"
});
});
}
});
/*$ (' #menu '). Accordion ({
Onselect:function (Title,index) {
$ ("Ul[name= '" "+title+" '] "). Tree ({
URL: ' menu/getmodules?menuname= ' +title
});
Alert (title);
}
}); */
});
Html:
<div data-options= "region: ' West ', split:true" title= "navigation menu" style= "width:180px;" >
<div id= "Menu" class= "easyui-accordion" data-options= "Fit:true,border:false" ></div>
</div>
Note that the red part, when ID is menu, does not know whether the Easyui custom ID is conflicting, no matter how the Fit property is set, the parent container cannot be filled, and the problem is resolved after modifying to Menuxx
Easy UI Auto-generated accordion not adaptive parent container problem