Ext.define('myComponent', {
extend: 'Ext.Component',
config: {
prop1: null,
...
},
items:[{
xtype: 'textfield',
bind: '{vmprop1}'
}],
constructor: function(config) {
this.initConfig(config);
return this;
}
applyProp1: function(newValue) {
if (typeof pronewValue1!== 'number' || newValue< 0) {
console.warn("Invalid prop1, must be a positive number");
return;
}
return prop1;
},
updateProp1: function(newValue, oldValue) {
this.getViewModel().set('vmprop1', newValue);
this.fireEvent('prop1_change', this, newValue, oldValue);
}
});