我使用 jQuery nestable 和 jQuery标签创建菜单编辑器,我会将每个标签内的earch菜单项保存在下面
这是html中的标签
<ul class="nav nav-tabs">
<li class="active"><a href="#tab_a" data-toggle="tab"> English </a></li>
<li><a href="#tab_b" data-toggle="tab"> Khmer </a></li>
<li><a href="#tab_c" data-toggle="tab"> Chinese </a></li>
</ul>
按各种语言标记内容
<div class="tab-content">
<!--tabs_a for English Languages-->
<div class="tab-pane" id="tab_a">
<input type="text" id="entity_type" name="entity" value="<?php echo $entity;?>"/>
<div class='dd' id='product_lista'>
<ol class="dd-list">
<li class="dd-item dd-collapsed" data-id="11"><div class="dd-handle">something</div></li>
<li class="dd-item dd-collapsed" data-id="12"><div class="dd-handle">something</div></li>
<li class="dd-item dd-collapsed" data-id="13"><div class="dd-handle">something</div></li>
</ol>
</div>
</div>
<!--tabs_b for Khmer Languages-->
<div class="tab-pane" id="tab_b">
<input type="text" id="entity_type" name="entity" value="<?php echo $entity;?>" />
<div class='dd' id='product_listb'>
<ol class="dd-list">
<li class="dd-item dd-collapsed" data-id="11"><div class="dd-handle">something</div></li>
<li class="dd-item dd-collapsed" data-id="12"><div class="dd-handle">something</div></li>
<li class="dd-item dd-collapsed" data-id="13"><div class="dd-handle">something</div></li>
</ol>
</div>
</div>
<!--tabs_b for Chinese Languages-->
<div class="tab-pane" id="tab_b">
<input type="text" id="entity_type" name="entity" value="<?php echo $entity;?>"/>
<div class='dd' id='product_listc'>
<ol class="dd-list">
<li class="dd-item dd-collapsed" data-id="11"><div class="dd-handle">something</div></li>
<li class="dd-item dd-collapsed" data-id="12"><div class="dd-handle">something</div></li>
<li class="dd-item dd-collapsed" data-id="13"><div class="dd-handle">something</div></li>
</ol>
</div>
</div>
</div>
这是 jquery可嵌套插件
$("#product_lista, #product_listb, #product_listc").nestable({
maxDepth: 10,
collapsedClass: 'dd-collapsed',
}).nestable('collapseAll');
结果如下图所示
它也适用于 Tabs_a ,但不适用于其他标签
不适用于 Tabs_b 和 Tabs_c
请帮忙