Last active
May 30, 2017 10:00
-
-
Save Ridhwana/4d4d919fa716f94a6eb90bf3a239c6a0 to your computer and use it in GitHub Desktop.
ember-js-tree
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
searchTerm: '', | |
plugins: 'search', | |
searchOptions: { | |
'show_only_matches' : true | |
}, | |
data: [ | |
{ | |
'text': 'Company 1', | |
'id': 'company-1', | |
'state': { | |
'opened': true | |
}, | |
'a_attr': { | |
'people': 100 | |
}, | |
'children': [ | |
{ 'text' : 'Headoffice', | |
'state': { | |
'opened': true | |
}, | |
'children': [ | |
{ 'text' : 'Branch 1' }, | |
{ 'text' : 'Branch 2' }, | |
] | |
} | |
] | |
}, | |
{ 'text': 'Company 2', | |
'children': [ | |
{'text': 'Headoffice' } | |
] | |
} | |
], | |
actions: { | |
handleJstreeEventDidOpen(e, data) { | |
alert('opened node'); | |
}, | |
closeAllNodes() { | |
this.get('jstreeActionReceiver').send('closeAll'); | |
} | |
} | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body { | |
margin: 12px 16px; | |
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; | |
font-size: 12pt; | |
} | |
button, input { | |
margin: 30px | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": "0.12.1", | |
"EmberENV": { | |
"FEATURES": {} | |
}, | |
"options": { | |
"use_pods": false, | |
"enable-testing": false | |
}, | |
"dependencies": { | |
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js", | |
"ember": "2.12.0", | |
"ember-template-compiler": "2.12.0", | |
"ember-testing": "2.12.0" | |
}, | |
"addons": { | |
"ember-data": "2.12.1", | |
"ember-cli-jstree": "1.0.9" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment