jQuery EasyUI Extension - Editable Tree
Usage
Create Tree
<ul id="tt"></ul>
$('#tt').etree({
url: 'tree_data.json',
createUrl: ...,
updateUrl: ...,
destroyUrl: ...,
dndUrl: ...
});
Set the url, createUrl, updateUrl, destroyUrl, and dndUrl properties to automatically synchronize data between the client and the server.
url: Returns the tree data.
createUrl: When creating a new node, the tree will pass a parameter named 'parentId' to the server, indicating the parent node's id.
{"id":1,"text":"new node"}
updateUrl: When updating a node, the tree will pass 'id' and 'text' parameters to the server.
destroyUrl: When destroying a node, the tree will pass the 'id' parameter to the server.
dndUrl: When dragging and dropping a node, the tree will pass the following parameters to the server:
Methods
This method extends from the tree, and below are the methods added for the editable tree (etree).
Name | Parameters | Description |
---|---|---|
options | none | Returns the options object. |
create | none | Creates a new node. |
edit | none | Edits the currently selected node. |
destroy | none | Destroys the currently selected node. |