跳转到主要内容

callEvent

Description

触发一个内部事件

callEvent: (name: string, params: any[]) => boolean

Parameters

  • name - (required) string - 事件名称,大小写不敏感
  • params - (required) array - 包含与事件相关数据的数组

Returns

  • result - (boolean) - false,如果任一事件处理程序返回了false。否则,返回true

Example

scheduler.attachEvent("CustomEvent", function(param1, param2){
return true;
});

var res = scheduler.callEvent("CustomEvent", [param1, param2]);

Details

事件通常会自动触发,因此很少需要使用此方法。

Need help?
Got a question about the documentation? Reach out to our technical support team for help and guidance. For custom component solutions, visit the Services page.