JS插件Fancytree使用分享及源码分析

本文分享了Fancytree这款强大的基于jQuery和jQuery UI的树形插件,介绍了其丰富的功能,如节点过滤、即时编辑、键盘事件等。详细讲解了配置选项如autoCollapse和selectMode,并分享了ES6模块化引入的经验,强调了在使用jQuery UI时需引入'jquery-ui-bundle'。此外,还讨论了如何在数据动态变化时重新渲染Fancytree和获取选中节点数据的方法。最后,对Fancytree源码进行了简要分析,指出其避免重复声明的机制。
摘要由CSDN通过智能技术生成

fancytree

fancytree是一款基于jq和jq-ui的树形插件,相比普通的jsTree,fancytree扩展的功能非常的多,除了checkbox选中,拖拽排序等基础的功能,还有节点过滤,即时编辑,tabletree(在列表中展示jstree),各种键盘事件,以及各种皮肤样式。
插件地址:https://github.com/mar10/fancytree
当前分享版本:2.22.5

配置介绍

$("#selector").fancytree({
    activeVisible: true, // Make sure, active nodes are visible (expanded)
    aria: true, // Enable WAI-ARIA support
    autoActivate: true, // Automatically activate a node when it is focused using keyboard
    autoCollapse: false, // Automatically collapse all siblings, when a node is expanded
    autoScroll: false, // Automatically scroll nodes into visible area
    clickFolderMode: 4, // 1:activate, 2:expand, 3:activate and expand, 4:activate (dblclick expands)
    checkbox: false, // Show checkboxes
    debugLevel: 2, // 0:quiet, 1:normal, 2:debug
    disabled: false, // Disable control
    focusOnSelect: false, // Set focus when node is checked by a mouse click
    escapeTitles: false, // Escape `node.title` content for display
    generateIds: false, // Generate id attributes like <span id=
  • 2
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值