Jquery easyui accordion通过后台加载数据,显示列表,可以加载初始化界面,但是点击基础菜单子菜单异常
以下是加载代码$(function(){$.ajax({type:'POST',dataType:"json",url:'/getAllMenu',success:fun...
以下是加载代码
$(function() { $.ajax({ type : 'POST', dataType : "json", url : '/getAllMenu', success : function(data) { $.each(data, function(i, n) { // alert(i+" "+n) $('#nav').accordion( 'add', { menuid : n.menu_id, title : n.menu_name, selected : false, content : '<div style="padding:10px"><ul name="' + n.menu_name + '">' + '</ul></div>', }); }); } });
var pp = $('#nav').accordion({ onSelect : function(title, index) { // alert(title+" "+index); $("ul[name='" + title + "']").tree({ url : '/getchild?parent=' + encodeURI(title), }); // 获取被选中的panel// var p = $('#nav').accordion('getSelected');// if (p) {// var index = $('#nav').accordion('getPanelIndex', p);// index.panel('refresh','/getchild?parent=' + encodeURI(title));// }
} });
}); 展开
$(function() { $.ajax({ type : 'POST', dataType : "json", url : '/getAllMenu', success : function(data) { $.each(data, function(i, n) { // alert(i+" "+n) $('#nav').accordion( 'add', { menuid : n.menu_id, title : n.menu_name, selected : false, content : '<div style="padding:10px"><ul name="' + n.menu_name + '">' + '</ul></div>', }); }); } });
var pp = $('#nav').accordion({ onSelect : function(title, index) { // alert(title+" "+index); $("ul[name='" + title + "']").tree({ url : '/getchild?parent=' + encodeURI(title), }); // 获取被选中的panel// var p = $('#nav').accordion('getSelected');// if (p) {// var index = $('#nav').accordion('getPanelIndex', p);// index.panel('refresh','/getchild?parent=' + encodeURI(title));// }
} });
}); 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询