add tree view

This commit is contained in:
Xuan Sang LE
2017-08-26 20:27:43 +02:00
parent 4cf1d694f9
commit 599e27bb01
13 changed files with 165 additions and 79 deletions

View File

@ -3,7 +3,7 @@
<afx-tree-view data-id="mytree"> </afx-tree-view>
<afx-hbox>
<afx-button data-height="30" text="Read more" iconclass="fa fa-camera-retro fa-lg" id="button"></afx-button>
<afx-switch data-height="30"></afx-switch>
<afx-switch enable= true data-height="30"></afx-switch>
<afx-calendar-view></afx-calendar-view>
<afx-color-picker></afx-color-picker>
<afx-list-view data-id = "mylist" dropdown = "true" width="200" data-height = "40"></afx-list-view>

View File

@ -11,8 +11,10 @@ class Files extends this.OS.GUI.BaseApplication
m.show(e)
@on "fileselect", (d) -> console.log d
#load home directory
@_api.VFS.scandir 'home:///',
p = 'home:///'
@_api.VFS.scandir p,
(d) ->
me.view.set "path", p
me.view.set "data", d.result
, (e, s) ->
alert "cannot open dir"
@ -46,9 +48,9 @@ class Files extends this.OS.GUI.BaseApplication
{ text: "Navigation bar", dataid: "#{@name}-nav" },
{ text: "Hidden files", dataid: "#{@name}-hidden" },
{ text: "Type", child: [
{ text: "Icon view", dataid: "#{@name}-icon", type: 'icon' },
{ text: "List view", dataid: "#{@name}-list", type: 'list' },
{ text: "Tree view", dataid: "#{@name}-tree", type: 'tree' }
{ text: "Icon view", radio: true, dataid: "#{@name}-icon", type: 'icon' },
{ text: "List view", radio:true, checked: true, dataid: "#{@name}-list", type: 'list' },
{ text: "Tree view", radio:true, dataid: "#{@name}-tree", type: 'tree' }
], onmenuselect: (e) ->
me.view.set 'view', e.item.data.type
},