jQuery EasyUI Form Plugin - Combotree
jQuery EasyUI Plugins
Extends $.fn.combo.defaults and $.fn.tree.defaults. Override the default defaults via $.fn.combotree.defaults.
The combotree combines a selection control with a drop-down tree. It is similar to the combobox, except that the list is replaced by a tree component. The combotree supports trees with tri-state checkboxes for multiple selection.
Depends on
- combo
- tree
Usage
Create a combotree from markup.
Create a combotree using JavaScript.
$('#cc').combotree({
url: 'get_data.php',
required: true
});
property
This property extends from the combo and tree; the following are properties added or overridden for the combotree.
| Name | Type | Description | Default value |
|---|---|---|---|
| editable | boolean | Defines whether the user can type text directly into the text field. | false |
Events
This event extends from the combo and tree
Method
This method extends from the combo; the following are methods added or overridden for the combotree.
| Name | Parameters | Description |
|---|---|---|
| options | none | Return the options object. |
| tree | none | Returns the tree object. The following example demonstrates how to get the selected tree node. |
var t = $('#cc').combotree('tree'); // get the tree object var n = t.tree('getSelected'); // get selected node alert(n.text);| onSelect | event | loadData | data | Remembers the local tree data.
Code example:
$('#cc').combotree('loadData', [{
id: 1,
text: 'Languages',
children: [{
id: 11,
text: 'Java'
},{
id: 12,
text: 'C++'
}]
}]);
| onSelect | event | reload | url | Requests the remote tree data again. Pass the 'url' parameter to override the original URL value.| onSelect | event | clear | none | Clears the component value.| onSelect | event | setValues | values | Sets the array of component values.
Code example:
$('#cc').combotree('setValues', [1,3,21]);
| onSelect | event | setValue | value | Sets the component value.
Code example:
$('#cc').combotree('setValue', 6);
|
jQuery EasyUI Plugins