easyui根据tree数据动态生成accordion面板

效果:

easyui根据tree数据动态生成accordion面板_第1张图片

示例数据:

easyui根据tree数据动态生成accordion面板_第2张图片


var url = 'menu/menus.json';
    $.post(url, function (data) {
        $.each(data, function (i, n) {
            $west_accordion.accordion('add', {
                content: '<ul style="padding: 5px 10px"></ul>',
                title: n.text,
                selected: i == 0
            });
            $west_accordion.accordion('getPanel', i).children().tree({
                data: n.children,
                animate: true,
                onClick: openTab
            });
        });
    }, 'json');


你可能感兴趣的:(easyui,accordion)