最近项目要在同一个页面加载 多个ztree做不同分类的选择 看了看官方文档,决定从select_checkbox_menu入手
触发 跟值返回
ztree初始化成功后的treeID 是容纳数据的容器的id 比如下面的edu_type
<a href="javascript:;" id="input_format_list_a" onclick="showMenu('format_list');" >资源格式</a> <input id="input_format_list" type="hidden" name="category['format_list']" readonly value="" style="width:120px;" />
ztree 初始化的id
<div id="menuContent" style="display:none; position: absolute;">
<ul id="edu_type" class="ztree" style="margin-top:0; width:280px; height: 300px;"></ul>
<ul id="learner_list" class="ztree" style="margin-top:0; width:280px; height: 300px;"></ul>
<ul id="grade_list" class="ztree" style="margin-top:0; width:280px; height: 300px;"></ul>
<ul id="curriculum_list" cla

本文介绍如何在同一个页面上使用ztree加载多个分类选择,通过分析官方文档,从select_checkbox_menu功能出发,实现ztree的初始化和值的返回。关键在于理解ztree成功初始化后,其treeID为数据容器的id,例如'edu_type',以及在页面中应用的js代码。
最低0.47元/天 解锁文章
5628

被折叠的 条评论
为什么被折叠?



