MCPcopy Create free account
hub / github.com/neomjs/neo / createExampleComponent

Method createExampleComponent

examples/treeAccordion/MainContainer.mjs:83–171  ·  view source on GitHub ↗

* @returns {*}

()

Source from the content-addressed store, hash-verified

81 * @returns {*}
82 */
83 createExampleComponent() {
84 const me = this,
85 store = Neo.create(Store, {
86 keyProperty: 'id',
87 model : {
88 fields: [
89 {name: 'collapsed', type: 'Boolean'},
90 {name: 'content', type: 'String'},
91 {name: 'iconCls', type: 'String'},
92 {name: 'id', type: 'Integer'},
93 {name: 'isLeaf', type: 'Boolean'},
94 {name: 'name', type: 'String'},
95 {name: 'parentId', type: 'Integer'}
96 ]
97 },
98
99 autoLoad: true,
100 url : '../../examples/treeAccordion/tree.json'
101 });
102
103 return Neo.ntype({
104 ntype: 'container',
105
106 stateProvider: {
107 data: {
108 selection: [{name: 'Please select something'}]
109 }
110 },
111
112 layout: {ntype: 'hbox', align: 'stretch'},
113 items : [{
114 module: AccordionTree,
115
116 bind: {selection: {key: 'selection', twoWay: true}},
117
118 store: store,
119
120 /*
121 * We are using data-binding.
122 * Here is an example for listener and controller
123 */
124 // controller: {
125 // module: ViewController,
126 //
127 // onAccordionItemClick(record) {
128 // let viewport = Neo.get('neo-configuration-viewport-1'),
129 // outputEl = viewport.getReference('output');
130 //
131 // outputEl.html = record.name;
132 // }
133 // },
134 //
135 // listeners: {
136 // leafItemClick: 'onAccordionItemClick'
137 // }
138
139 listeners: {
140 selectPreFirstItem: () => Neo.log('listener selectPreFirstItem fired'),

Callers

nothing calls this directly

Calls 2

createMethod · 0.45
logMethod · 0.45

Tested by

no test coverage detected