easy-ui tree

來源:互聯網
上載者:User

標籤:http   io   os   ar   strong   for   資料   sp   on   

 

特性

名稱

類型

說明

預設值

url

string

擷取遠端資料的 URL 。

null

method

string

擷取資料的 http method 。

post

animate

boolean

定義當節點展開摺疊時是否顯示動畫效果。

false

checkbox

boolean

定義是否在每個節點前邊顯示 checkbox 。

false

cascadeCheck

boolean

定義是否級聯檢查。

true

onlyLeafCheck

boolean

定義是否只在分葉節點前顯示 checkbox 。

false

dnd

boolean

定義是否啟用拖放。

false

data

array

載入的節點資料。

null

事件

很多事件的回呼函數需要 ‘node‘ 函數,它包含下列特性:

  • id:綁定到節點的標識值。
  • text:顯示的文字。
  • checked:是否節點被選中。
  • attributes:綁定到節點的自訂屬性。
  • target:目標的 DOM 對象。

名稱

參數

說明

onClick

node

當使用者點擊一個節點時觸發, node 參數包含下列特性:
id:節點的 id
text:節點的文字
checked:節點是否被選中
attributes:節點自訂屬性
target:被點擊目標的 DOM 對象

onDblClick

node

當使用者雙擊一個節點時觸發。

onBeforeLoad

node, param

當載入資料的請求發出前觸發,返回 false 就取消載入動作。

onLoadSuccess

node, data

當資料載入成功時觸發。

onLoadError

arguments

當資料載入失敗時觸發, arguments 參數與 jQuery.ajax 的‘error‘ 函數一樣。.

onBeforeExpand

node

節點展開前觸發,返回 false 就取消展開動作。

onExpand

node

當節點展開時觸發。

onBeforeCollapse

node

節點摺疊前觸發,返回 false 就取消摺疊動作。

onCollapse

node

當節點摺疊時觸發。

onCheck

node, checked

當使用者點擊 checkbox 時觸發。

onBeforeSelect

node

節點被選中前觸發,返回 false 就取消選擇動作。

onSelect

node

當節點被選中時觸發。

onContextMenu

e, node

當右鍵點擊節點時觸發。

onDrop

target, source, point

當節點被拖拽施放時觸發。
target:DOM 對象,拖放的目標節點。
source:源節點。
point:表示拖放操作,可能是值是: ‘append‘、‘top‘ 或 ‘bottom‘。

onBeforeEdit

node

編輯節點前觸發。

onAfterEdit

node

編輯節點後觸發。

onCancelEdit

node

當取消編輯動作時觸發。

方法

名稱

參數

說明

options

none

返回樹的 options。

loadData

data

載入樹的資料。

getNode

target

擷取指定的節點對象。

getData

target

擷取指定的節點資料,包括它的子節點。

reload

target

重新載入樹的資料。

getRoot

none

擷取根節點,返回節點對象。

getRoots

none

擷取根節點們,返回節點數組。

getParent

target

擷取父節點, target 參數指節點的 DOM 對象。

getChildren

target

擷取子節點, target 參數指節點的 DOM 對象。

getChecked

none

擷取所有選中的節點。

getSelected

none

擷取選中的節點並返回它,如果沒有選中節點,就返回 null。

isLeaf

target

把指定的節點定義成分葉節點, target 參數表示節點的 DOM 對象。

find

id

找到指定的節點並返回此節點對象。

select

target

選中一個節點, target 參數表示節點的 DOM 對象。

check

target

把指定節點設定為勾選。

uncheck

target

把指定節點設定為未勾選。

collapse

target

摺疊一個節點, target 參數表示節點的 DOM 對象。

expand

target

展開一個節點, target 參數表示節點的 DOM 對象。

collapseAll

target

摺疊所有的節點們。

expandAll

target

展開所有的節點們。

expandTo

target

從指定節點的根部展開。

append

param

追加一些子節點們到一個父節點, param 參數有兩個特性:
parent:DOM 對象,追加到的父節點,如果沒有分配,則追加為根節點。
data:數組,節點們的資料。

toggle

target

切換節點的展開/摺疊狀態, target 參數表示節點的 DOM 對象。

insert

param

在指定節點的前邊或後邊插入一個節點, param 參數包含下列特性:
before:DOM 對象,前邊插入的節點。
after:DOM 對象,後邊插入的節點。
data:對象,節點資料。

remove

target

移除一個節點和它的子節點們, target 參數表示節點的 DOM 對象。

pop

target

彈出一個節點和它的子節點們,此方法和 remove 一樣,但是返回了移除的節點資料。

update

param

跟心指定的節點, param 參數有下列特性:
target(DOM 對象,被更新的節點)、id、text、iconCls、checked、等等。

enableDnd

none

啟用拖放功能。

disableDnd

none

禁用拖放功能。

beginEdit

nodeEl

開始編輯節點。

endEdit

nodeEl

結束編輯節點。

cancelEdit

nodeEl

取消編輯節點。

 

easy-ui tree

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.