EasyUI - 设置accordion全部展开

盖和泰
2023-12-01

需要设置两个地方:

1)在easyui-accordion处设置 data-options="multiple:true"防止后续不能展开多个面板

2)在面板里设置data-option="collapsed:false"默认展开面板

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Basic Accordion - jQuery EasyUI Demo</title>
 <link rel="stylesheet" type="text/css" href="http://www.jeasyui.com/easyui/themes/default/easyui.css">
    <link rel="stylesheet" type="text/css" href="http://www.jeasyui.com/easyui/themes/icon.css">
    <link rel="stylesheet" type="text/css" href="http://www.jeasyui.com/easyui/themes/color.css">
    <link rel="stylesheet" type="text/css" href="http://www.jeasyui.com/easyui/demo/demo.css">
    <script type="text/javascript" src="http://code.jquery.com/jquery-1.6.min.js"></script>
    <script type="text/javascript" src="http://www.jeasyui.com/easyui/jquery.easyui.min.js"></script>
</head>
<body>
    <div class="easyui-accordion" style="width:500px;" data-options="multiple:true">
        <div title="About" data-options="iconCls:'icon-ok',collapsed:false" style="overflow:auto;padding:10px;">
            <p>面板已展开1</p>
        </div>
        <div title="Help" data-options="iconCls:'icon-help',collapsed:false" style="padding:10px;">
            <p>面板已展开2</p>     
        </div>
        <div title="TreeMenu" data-options="iconCls:'icon-search',collapsed:false" style="padding:10px;">
            <p>面板已展开3</p>
        </div>
    </div>
</body>
</html>
 类似资料: