add tree-view

This commit is contained in:
lxsang 2020-04-05 22:52:49 +02:00
parent 9924c642c5
commit 64f055e7ce

View File

@ -145,12 +145,12 @@ class TreeViewTag extends Ant.OS.GUI.BaseTag
__selectedItem__: (v) -> __selectedItem__: (v) ->
return unless v return unless v
@get("selectedItem").set "selected", false if @get("selectedItem")
v.set "selected", true v.set "selected", true
itemclick: (e, flag) -> itemclick: (e, flag) ->
return unless e and e.item return unless e and e.item
return if e.item is @get("selectedItem") and not flag return if e.item is @get("selectedItem") and not flag
@get("selectedItem").set "selected", false if @get("selectedItem")
@set "selectedItem", e.item @set "selectedItem", e.item
evt = { id: @aid(), data: e } evt = { id: @aid(), data: e }
if flag if flag