我正在使用sapui5面板,我允许展开它将在工具栏“>”上显示默认图标,当我点击它时,它会togglecollapse,但我想在其上添加一些动作。
这是面板,最后有一个图标。 我们点击它时是否有想法覆盖功能,自定义功能或在该图标上添加一些操作?
我的目的是,我想在面板折叠之前添加警告消息,如果我点击“是”确认,它可以崩溃,“否”它仍然相同,什么都不做。
答案 0 :(得分:0)
你试过attachExpand
吗?
https://sapui5.hana.ondemand.com/docs/api/symbols/sap.m.Panel.html#attachExpand
我还是这个ui5的新手:p
我们走了
var panel = new sap.m.Panel("panel-1", {
headerText:"Test Panel",
expandable: true
});
panel.setExpanded = function (bExpanded) {
if (bExpanded === this.getExpanded()) {
return this;
}
//may need to reset this later
this.setProperty("expanded", bExpanded, true);
if (!this.getExpandable()) {
return this;
}
//add custom logic here
if(bExpanded){
}
//custom logic
this._getIcon().$().attr("aria-expanded", this.getExpanded());
this._toggleExpandCollapse();
this._toggleCssClasses();
this.fireExpand({ expand : bExpanded });
return this;
};