Skip to content

Commit b94a0d8

Browse files
1 parent 422e31d commit b94a0d8

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

app/webapp/controller/App.controller.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,34 @@ sap.ui.define("z2ui5/History", ["sap/ui/core/Control"], (Control) => {
187187
}
188188
);
189189

190+
sap.ui.define("z2ui5/Tree", ["sap/ui/core/Control"], (Control) => {
191+
"use strict";
192+
193+
return Control.extend("z2ui5.Tree", {
194+
metadata: {
195+
properties: {
196+
tree_id: {
197+
type: "string"
198+
}
199+
}
200+
},
201+
202+
setBackend() {
203+
z2ui5.treeState = z2ui5.oView.byId( this.getProperty("tree_id") ).getBinding('items').getCurrentTreeState();
204+
},
205+
206+
init() {
207+
z2ui5.onBeforeRoundtrip.push(this.setBackend.bind(this));
208+
},
209+
210+
renderer(oRm, oControl) {
211+
setTimeout(() => {
212+
z2ui5.oView.byId( this.getProperty("tree_id") ).setTreeState( z2ui5.treeState );
213+
}, 100);
214+
}
215+
});
216+
});
217+
190218
sap.ui.define("z2ui5/Scrolling", ["sap/ui/core/Control"], (Control) => {
191219
"use strict";
192220

0 commit comments

Comments
 (0)