jQuery EasyUI form plugin - Combotree combination tree
Extends from $ .fn.combo.defaults and $ .fn.tree.defaults. By $ .fn.combotree.defaults override the default defaults.
Combination Tree (combotree) to select and control the drop-down tree together. It combo box (combobox) is similar, except that the list of replacement components into a tree. Combination Tree (combotree) tree with tree state support for multiple choice check box.
rely
- combo
- tree
usage
Create a combination from the tag tree (combotree).
<Select id = "cc" class = "easyui-combotree" style = "width: 200px;" data-options = "url: 'get_data.php', required: true"> </ Select>
Use javascript to create a combination of tree (combotree).
<Input id = "cc" value = "01">
$ ( '# Cc'). Combotree ({ url: 'get_data.php', required: true });
Attributes
The property extends from the combination (combo) and tree (tree), below is a combination of tree (combotree) to add or rewrite attributes.
名称 | 类型 | 描述 | 默认值 |
---|---|---|---|
editable | boolean | 定义用户是否可以直接往文本域中输入文字。 | false |
event
The event expanded from a combination (combo) and tree (tree)
method
The methods extend from a combination (combo), below is a combination of tree (combotree) add or override methods.
名称 | 参数 | 描述 |
---|---|---|
options | none | 返回选项(options)对象。 |
tree | none | 返回树(tree)对象。下面的实例演示如何取得选中的树节点。
var t = $('#cc').combotree('tree'); // get the tree object var n = t.tree('getSelected'); // get selected node alert(n.text); |
loadData | data | 记住本地的树(tree)数据。 代码实例: $('#cc').combotree('loadData', [{ id: 1, text: 'Languages', children: [{ id: 11, text: 'Java' },{ id: 12, text: 'C++' }] }]); |
reload | url | 再一次请求远程的树(tree)数据。传 'url' 参数来重写原始的 URL 值。 |
clear | none | 清除组件的值。 |
setValues | values | 设置组件值的数组。 代码实例: $('#cc').combotree('setValues', [1,3,21]); |
setValue | value | 设置组件的值。 代码实例: $('#cc').combotree('setValue', 6); |
jQuery EasyUI plugin