sap.ui.define([
"sap/tnt/SideNavigation",
"SimpleDemo/container/SideMenuRender",
"SimpleDemo/container/SideMenuList",
"sap/m/Image",
"sap/ui/core/Fragment"
], function (SideNavigation, SideMenuRender, SideMenuList, Image, Fragment) {
"use strict";
return SideNavigation.extend("SimpleDemo.container.SideMenu", {
metadata: {
aggregations: {
/*...*/
/*...*/
metadata: {
aggregations: {
image: {
type: "sap.m.Image",
multiple: false
},
panel: { type: "sap.ui.core.Control", multiple: false },
items: { type: SideMenuList, multiple: true, singularName: "item" },
},
events: {
}
},
init: function () {
this.setAggregation("image", new Image({
src: "{/ProfileImage}",
// width: "84%"
width: "45px"
}).addStyleClass("sapUiSmallMarginBottom sideMenuImage"));
var ofooter = new sap.tnt.NavigationList();
ofooter.addItem(new sap.tnt.NavigationListItem({
icon: "sap-icon://menu2"
}));
this.setAggregation("footer", ofooter);
var that = this;
Fragment.load({
name: "SimpleDemo.fragments.ItemPanel",
controller: this
}).then(function (oPanel) {
that.setAggregation("panel", oPanel);
});
/*...*/
/*...*/
Fragment.load({
name: "SimpleDemo.fragments.ItemPanel",
controller: this
}).then(function (oPanel) {
that.setAggregation("panel", oPanel);
});
SideNavigation.prototype.init.call(this);
SideNavigation.prototype._itemSelectionHandler = function (event) {
var item = event.getParameter('item');
if (item.getKey() !== "workArea") {
this.setSelectedItem(item);
this.fireItemSelect({
item: item
});
SideMenuRender.hasItemPanel = false;
this.rerender();
} else {
//Register event click outside side menu
this.delegate = {
onclick: this.closeItemPanel.bind(this)
};
//this.getParent().byId("pageContainer").addEventDelegate(this.delegate)
if (SideMenuRender.hasItemPanel) {
//When user just click the second item but not navigation
this.closeItemPanel();
} else {
SideMenuRender.hasItemPanel = true;
this.rerender();
}
}
};
SideNavigation.prototype.onAfterRendering = function () {
};
SideNavigation.prototype.onBeforeRendering = function () {
};
/*...*/
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
11 | |
9 | |
8 | |
7 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |