CustomBindable for enabling and disabling view model bindings when needed
Demo: https://fiddle.sencha.com/#fiddle/1c26
How to use it:
- Declare bindings as config:
Ext.define('Fiddle.view.MyTab',{
extend: 'Ext.grid.Panel',
mixins: {
customBindable: 'Fiddle.mixin.CustomBindable'
},
config: {
customBindings: {
$value: [
{
bind: '{simpsons}',
get: function (data) {
console.log('Binding called, store updated');
this.getStore().setData(data);
return data;
}
}
],
lazy: true
}
}
});
- Declare bindings trough init method:
Ext.define('Fiddle.view.MyTab',{
extend: 'Ext.grid.Panel',
mixins: {
customBindable: 'Fiddle.mixin.CustomBindable'
},
initCustomBindings: function() {
return [
{
bind: '{simpsons}',
get: function (data) {
console.log('Binding called, store updated');
this.getStore().setData(data);
return data;
}
}
];
}
});