0

I'm new in ExtJS 4, and I make an extended Data Model. I want to listen model's set function. How can I make a custom listener on set, or override set with original set functions + extensions?

Eleanor
  • 358
  • 5
  • 24

1 Answers1

2

You can create your own set function and call callParent:

Ext.define('My.data.Model', {
    extend: 'Ext.data.Model',

    set: function () {
        this.callParent(arguments); // original set functions
        console.log(arguments);     // extensions
    }
});

Working example: http://jsfiddle.net/RyMGc/

CD..
  • 72,281
  • 25
  • 154
  • 163