在 SAP 中從控制器的其他方法呼叫事件函式
建議不要從任何其他函式呼叫事件函式,但你可以做的就是將事件函式實現重構到一個單獨的函式中,並從任何其他函式呼叫它,如下所示
示例
BtnPress: function(oEvent) {
// Separate the implementation in the helper function
this.btnPressHelper();
}
// Define the helper
btnPressHelper: function() {
//logic here
}
// call the helper from whichever function you want to get the desired output
PerformSomething: function() {
this.btnTapHelper();
}
廣告
資料結構
網路
RDBMS
作業系統
Java
iOS
HTML
CSS
Android
Python
C 程式設計
C++
C#
MongoDB
MySQL
Javascript
PHP