1
SAPUI5 컨트롤 GenericTile을 사용하고 headerImage 및 click 이벤트를 모두 추가했습니다. 이 아이콘을 클릭하면 타일의 이벤트 핸들러가 먼저 트리거되므로 아이콘 클릭 자체에 반응 할 수 없습니다 (당연히 다른 작업을 수행해야 함).SAPUI5 : 클릭 이벤트 올바르게 처리
var oGenericTile = new sap.suite.ui.commons.GenericTile({
frameType: "TwoByOne",
header: "My HEader",
headerImage: "sap-icon://settings",
tileContent: oTileContent
});
oGenericTile._oImage.attachPress(function(oEvent) {
sap.m.MessageToast.show("Icon has been pressed");
oEvent.cancelBubble();
oEvent.preventDefault();
});
oGenericTile.attachPress(function() {
sap.m.MessageToast.show("I am always triggered first!!! :-(");
});`
어떻게하면이 문제를 피할 수 있습니까?
감사 톤,
안톤
당신은 즉', 자신의 컨트롤과 함께'sap.suite.commons.GenericTile'을 확장 my.GenericTile' 필요와'my.GenericTile.prototype.onclick/ontapstart' 메소드를 오버라이드 (override). –