extjs覆盖动作类中的函数

时间:2013-09-20 18:40:23

标签: extjs override action

如何在自定义javascript文件中覆盖以下操作定义?

Ext.define("my.action.form.DataAction", {
   extend: "my.action.Action",
   requires: ["my.action.Action"],
   alias: "action.dataaction",
   notifyActionSuccess: function(component, msgTemplate, model) {

      console.log("original action action");

   }
});

1 个答案:

答案 0 :(得分:2)

Ext.override(my.action.form.DataAction, {
    notifyActionSuccess: function(component, msgTemplate, model) {

      console.log("a new overridden action action");

   }
});

或者您可以使用Ext.define:

Ext.define("my.action.form.DataActionOvrRide", {
    override: "my.action.form.DataAction",
    notifyActionSuccess: function(component, msgTemplate, model) {

        console.log("new overridden action action");

    }
});