# jstree
[jsTree](http://www.jstree.com/) is jquery plugin, that provides interactive trees. It is absolutely free, [open source](https://github.com/vakata/jstree) and distributed under the MIT license.
jsTree is easily extendable, themable and configurable, it supports HTML & JSON data sources, AJAX & async callback loading.
jsTree functions properly in either box-model (content-box or border-box), can be loaded as an AMD module, and has a built in mobile theme for responsive design, that can easily be customized. It uses jQuery's event system, so binding callbacks on various events in the tree is familiar and easy.
You also get:
* drag & drop support
* keyboard navigation
* inline edit, create and delete
* tri-state checkboxes
* fuzzy searching
* customizable node types
_Aside from this readme you can find a lot more info on [jstree.com](http://www.jstree.com) & [the discussion group](https://groups.google.com/forum/#!forum/jstree)_.
---
<!-- MarkdownTOC depth=0 autolink=true bracket=round -->
- [Getting Started](#getting-started)
- [Include all neccessary files](#include-all-neccessary-files)
- [Populating a tree using HTML](#populating-a-tree-using-html)
- [Populating a tree using an array \(or JSON\)](#populating-a-tree-using-an-array-or-json)
- [The required JSON format](#the-required-json-format)
- [Populating the tree using AJAX](#populating-the-tree-using-ajax)
- [Populating the tree using AJAX and lazy loading nodes](#populating-the-tree-using-ajax-and-lazy-loading-nodes)
- [Populating the tree using a callback function](#populating-the-tree-using-a-callback-function)
- [Working with events](#working-with-events)
- [Interacting with the tree using the API](#interacting-with-the-tree-using-the-api)
- [More on configuration](#more-on-configuration)
- [Plugins](#plugins)
- [checkbox](#checkbox)
- [contextmenu](#contextmenu)
- [dnd](#dnd)
- [massload](#massload)
- [search](#search)
- [sort](#sort)
- [state](#state)
- [types](#types)
- [unique](#unique)
- [wholerow](#wholerow)
- [More plugins](#more-plugins)
- [PHP demos moved to new repository](#php-demos-moved-to-new-repository)
- [License & Contributing](#license--contributing)
<!-- /MarkdownTOC -->
---
## Getting Started
### Include all neccessary files
To get started you need 3 things in your page:
1. jQuery (anything above 1.9.1 will work)
2. A jstree theme (there is only one theme supplied by default)
3. The jstree source file
```html
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/jstree/3.3.3/themes/default/style.min.css" />
<script src="//cdnjs.cloudflare.com/ajax/libs/jstree/3.3.3/jstree.min.js"></script>
```
_If you decide to host jstree yourself - the files are located in the `dist` folder. You can safely ignore the `dist/libs` folder._
---
### Populating a tree using HTML
Now we are all set to create a tree, inline HTML is the easiest option (suitable for menus). All you need to do is select a node (using a jQuery selector) and invoke the `.jstree()` function to let jstree know you want to render a tree inside the selected node. `$.jstree.create(element)` can be used too.
```html
<div id="container">
<ul>
<li>Root node
<ul>
<li>Child node 1</li>
<li>Child node 2</li>
</ul>
</li>
</ul>
</div>
<script>
$(function() {
$('#container').jstree();
});
</script>
```
[view result](http://jsfiddle.net/vakata/2kwkh2uL/)
_You can add a few options when rendering a node using a data-attribute (note the quotes):_
```html
<li data-jstree='{ "selected" : true, "opened" : true }'>Root node ...
```
---
### Populating a tree using an array (or JSON)
Building trees from HTML is easy, but it is not very flexible, inline JS data is a better option:
```html
<div id="container"></div>
<script>
$(function() {
$('#container').jstree({
'core' : {
'data' : [
{ "text" : "Root node", "children" : [
{ "text" : "Child node 1" },
{ "text" : "Child node 2" }
]
}
]
}
});
});
</script>
```
[view result](http://jsfiddle.net/vakata/2kwkh2uL/4478/)
Unlike the previous simple HTML example, this time the `.jstree()` function accepts a config object.
For now it is important to note that jstree will try to parse any data you specify in the `core.data` key and use it to create a tree. As seen in the previous example, if this key is missing jstree will try to parse the inline HTML of the container.
#### The required JSON format
The data you use must be in a specific format, each branch of the tree is represented by an object, which must at least have a `text` key. The `children` key can be used to add children to the branch, it should be an array of objects.
_Keep in mind, you can use a simple string instead of an object if all you need is node with the given text, the above data can be written as:_
```js
[ { "text" : "Root node", "children" : [ "Child node 1", "Child node 2" ] } ]
```
There are other available options for each node, only set them if you need them like:
* `id` - makes if possible to identify a node later (will also be used as a DOM ID of the `LI` node). _Make sure you do not repeat the same ID in a tree instance (that would defeat its purpose of being a unique identifier and may cause problems for jstree)_.
* `icon` - a string which will be used for the node's icon - this can either be a path to a file, or a className (or list of classNames), which you can style in your CSS (font icons also work).
* `data` - this can be anything you want - it is metadata you want attached to the node - you will be able to access and modify it any time later - it has no effect on the visuals of the node.
* `state` - an object specifyng a few options about the node:
- `selected` - if the node should be initially selected
- `opened` - if the node should be initially opened
- `disabled` - if the node should be disabled
- `checked` - __checkbox plugin specific__ - if the node should be checked (only used when `tie_selection` is `false`, which you should only do if you really know what you are doing)
- `undetermined` - __checkbox plugin specific__ - if the node should be rendered in undetermined state (only used with lazy loading and when the node is not yet loaded, otherwise this state is automatically calculated).
* `type` - __types plugin specific__ - the type of the nodes (should be defined in the types config), if not set `"default"` is assumed.
* `li_attr` - object of values which will be used to add HTML attributes on the resulting `LI` DOM node.
* `a_attr` - object of values which will be used to add HTML attributes on the resulting `A` node.
Here is a new demo with some of those properties set:
```html
<div id="container"></div>
<script>
$(function() {
$('#container').jstree({
'core' : {
'data' : [
{
"text" : "Root node",
"state" : {"opened" : true },
"children" : [
{
"text" : "Child node 1",
"state" : { "selected" : true },
"icon" : "glyphicon glyphicon-flash"
},
{ "text" : "Child node 2", "state" : { "disabled" : true } }
]
}
]
}
});
});
</script>
```
[view result](http://jsfiddle.net/vakata/2kwkh2uL/4479/)
---
### Populating the tree using AJAX
Building off of the previous example, let's see how to have jstree make AJAX requests for you.
```html
<div id="container"></div>
<script>
$(function() {
$('#container').jstree({
'core' : {
'data' : {
"url" : "//www.jstree.com/fiddle/",
"dataType" : "json" // needed only if you do not supply JSON headers
}
}
});
});
</script>
```
The server response is:
```json
[{
"id":1,"text":"Root node","children":[
{"
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
基于C++实现的激光点云处理工具,集成Cesium与Potree实现在线点云查看和处理+源码+项目文档,适合毕业设计、课程设计、项目开发。项目源码已经过严格测试,可以放心参考并在此基础上延申使用,详情见md文档~ LAS数据格式: .las格式是激光雷达数据的标准数据格式。一个.las数据集可以分为3个部分:1.公共头部块,2.可变长度记录和3.点数据记录,在公共头部块部分记录了数据集的描述。描述包括点的数量、每个点的长度、las数据集的类型等。因此,应该仔细处理这部分以获取数据集的信息;在可变长度记录中,这部分不一定需要,在大多数数据集中,这部分并不存在;最后一部分是点数据记录。这部分记录了所有的积分信息。
资源推荐
资源详情
资源评论
收起资源包目录
基于C++实现的激光点云处理工具,集成Cesium与Potree实现在线点云查看和处理+源码+项目文档(毕业设计&课程设计) (986个子文件)
enviroment.bash 2KB
Cholesky 1KB
CholmodSupport 2KB
classtype.conf 292B
Core 17KB
tinyxml2.cpp 69KB
LASProfile.cpp 40KB
LASReader.cpp 39KB
LASSkeleton.cpp 34KB
LidarFeaturePoints.cpp 33KB
LASDangerPoints.cpp 32KB
LASSimpleClassify.cpp 30KB
LASTowerClassify.cpp 26KB
WorkingConditionSimulation.cpp 23KB
GeometryAlgorithm.cpp 19KB
PotreeWriter.cpp 17KB
PotreeConverter.cpp 15KB
PointProcAlgorithm.cpp 13KB
tsmToUTM.cpp 13KB
LidarProc.cpp 11KB
LASFilter.cpp 10KB
LASHeader.cpp 9KB
LASPoint.cpp 8KB
PTXPointReader.cpp 8KB
LidarAlgorithmTest.cpp 8KB
FileHelper.cpp 7KB
LASModel.cpp 7KB
LASColorMap.cpp 7KB
stuff.cpp 7KB
LidarBaseTest.cpp 6KB
LASFormatTransform.cpp 6KB
LidarRegistration.cpp 5KB
BINPointReader.cpp 5KB
SparseGrid.cpp 5KB
LidarServer.cpp 4KB
Simulation.cpp 3KB
LASPointReader.cpp 3KB
PointAttributes.cpp 2KB
LidarFilterPCL.cpp 2KB
GridCell.cpp 1KB
LidarUtilTest.cpp 1KB
LASPointWriter.cpp 773B
LidarController.cpp 692B
LASReceive.cpp 691B
LidarUnitTest.cpp 549B
bootstrap.css 143KB
bootstrap.min.css 118KB
jquery-ui.css 35KB
style.css 31KB
jquery-ui.min.css 30KB
style.min.css 26KB
bootstrap-theme.css 26KB
bootstrap-theme.min.css 23KB
widgets.css 22KB
jquery-ui.structure.css 18KB
jquery-ui.theme.css 17KB
jquery-ui.structure.min.css 15KB
spectrum.css 15KB
jquery-ui.theme.min.css 14KB
potree.css 11KB
perfect-scrollbar.css 6KB
lighter.css 5KB
perfect-scrollbar.min.css 5KB
ol.css 4KB
InfoBoxDescription.css 3KB
Cesium3DTilesInspector.css 3KB
Animation.css 2KB
BaseLayerPicker.css 2KB
CesiumInspector.css 2KB
NavigationHelpButton.css 2KB
lighter.css 2KB
SceneModePicker.css 2KB
InfoBox.css 2KB
shared.css 2KB
Geocoder.css 2KB
Viewer.css 1KB
Timeline.css 1KB
bootstrap-treeview.css 1KB
ProjectionPicker.css 1KB
CesiumWidget.css 1006B
lighter.css 890B
lighterShared.css 886B
lighter.css 620B
webuploader.css 515B
webuploader.css 515B
lighter.css 397B
SelectionIndicator.css 338B
lighter.css 336B
lighter.css 269B
PerformanceWatchdog.css 256B
FullscreenButton.css 102B
VRButton.css 94B
south_sorvilier.dbf 20KB
Dense 122B
Eigen 35B
Eigenvalues 2KB
glyphicons-halflings-regular.eot 20KB
Geometry 2KB
loading.gif 5KB
throbber.gif 2KB
共 986 条
- 1
- 2
- 3
- 4
- 5
- 6
- 10
资源评论
梦回阑珊
- 粉丝: 4759
- 资源: 1641
下载权益
C知道特权
VIP文章
课程特权
开通VIP
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 【Unity角色控制器】Invector Third Person Controller - Basic Locomotion
- 基于django的鲜花分类系统的设计与实现
- 在线外卖平台源码 美团外卖源码 支持多商户+多样化配送费模式+本土外卖平台+支持第三方配送
- 卷积神经网络(CNN)-池化层python案例
- Wireshark Lua API主要接口
- 【Unity塔防游戏工具包】Tower Defense Toolkit 4 (TDTK-4)
- 配电网的潮流计算-采用二阶锥松弛和多面体逼近方法解决潮流计算问题matlab源码.zip
- FPGA市场和开发资源相关的视频
- LCD.ioc有关spi通信的
- BestLiu工具包!
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功