元のメソッドを呼び出す前に、いくつかのアクションを実行するために道場のspect.beforeを使用しています。ただし、aspect.before メソッド内でいくつかの基準が満たされていない場合、元のメソッドをキャンセルしようとしていますが、そのイベントをキャンセルできません。
require(["dojo/_base/declare",
"dojo/_base/lang",
"dojo/aspect",
"dojo/dom",
"dojo/on"],
function(declare, lang, aspect, dom, on) {
aspect.before(target,"onSave", function(event){
var mycriteria = //some logic to determine this value;
if(mycriteria == null || mycriteria == undefined){
//cancel the "onSave" method.
// if cancelling this is not possible, can I call "onCancel" method here that'll cancel this
//event?
}
});
}