擴展sap.ui.core.Icon我擴展了懸停事件處理sap.ui.core.Icon:與懸停事件或鼠標懸停
sap.ui.define(function() {
"use strict";
return sap.ui.core.Icon.extend("abc.reuseController.HoverIcon", {
metadata: {
events: {
"hover" : {}
}
},
// the hover event handler, it is called when the Button is hovered - no event registration required
onmouseover : function(evt) {
this.fireHover();
},
// add nothing, just inherit the ButtonRenderer as is
renderer: {}
});
});
事件的onmouseover永遠不會被解僱。我也用這個擴展名爲sap.m.Button和它works。但我需要這個sap.ui.core.Icon。
我也試過this jquery的例子,但它根本沒有工作。
$("testIcon").hover(function(oEvent){alert("Button" + oEvent.getSource().getId());});
請問,你知道爲什麼事件處理程序onmouseover沒有調用sap.ui.core.Icon嗎?或者你能否提出一些其他解決方案?
貝婁是我如何添加圖標,我sap.suite.ui.commons.ChartContainer:
var oFilterIcon = new HoverIcon({
tooltip : "{i18n>filter}",
src : "sap-icon://filter",
hover : function(oEvent){alert("Button" + oEvent.getSource().getId());},
});
this.byId("idChartContainer").addCustomIcon(oFilterIcon);
你的控制被命名爲'abc.reuseController .HoverIcon'在你的代碼示例中,但你添加了'sap.ui.core.HoverIcon'到你的ChartContainer。錯字? – schnoedel
謝謝,我打錯了,在這裏的計算器,在代碼中是正確的。 – Jaro