扩展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