相關依賴
- combo
- tree
使用
從標記創建combotree
<input id="cc" class="easyui-combotree" url="ashx/OrglistHandler.ashx" required="true" multiple="true" value="1" style="width: 204px;">
使用javascript創建combotree
<input id="cc" value="01">
$('#cc').combotree({url: 'get_data.php',required: true});
屬性
屬性繼承自 combo 和 tree, 以下是combotree重寫屬性.
| Name |
Type |
Description |
Default |
| editable |
boolean |
定義用戶是否可以直接輸入文本到選擇框. |
false |
事件
事件繼承自 combo 和 tree.
方法
方法繼承自 combo,以下是combotree新增和重寫的方法.
| Name |
Parameter |
Description |
| options |
none |
返回 options 對象. |
| tree |
none |
返回樹(tree)對象. 以下示例展示如何得到選擇的樹節點(node). var t = $('#cc').combotree('tree'); // 得到樹對象 var n = t.tree('getSelected'); // 得到選擇的節點 這里經過實踐測試應該使用t.tree('getChecked'); alert(n.text); |
| loadData |
data |
加載本地tree數據. 示例代碼: $('#cc').combotree('loadData', [{ id: 1, text: 'Languages', children: [{ id: 11, text: 'Java' },{ id: 12, text: 'C++' }] }]); |
| reload |
url |
重新請求遠程服務器端數據. 傳入'url'參數重寫原始的URL值. |
| clear |
none |
清除組件值. |
| setValues |
values |
設置組件值數組. 示例代碼: $('#cc').combotree('setValues', [1,3,21]); 注意:動態賦值時類似如下方式,'['+參數+']'方式無效 |
| setValue |
value |
設置組件值. 示例代碼: $('#cc').combotree('setValue', 6); |
| getValues |
none |
獲取組件值(多選時). |
| getValue |
none |
獲取組件值(單選時).
|
