Skip to content
This repository has been archived by the owner on Aug 5, 2022. It is now read-only.

CustomBindable for enabling and disabling view model bindings when needed

Notifications You must be signed in to change notification settings

vadimpopa/Ux.mixin.CustomBindable

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

Ux.mixin.CustomBindable

CustomBindable for enabling and disabling view model bindings when needed

Demo: https://fiddle.sencha.com/#fiddle/1c26

Alt Text

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;
            }
        }
      ];
	}
});

About

CustomBindable for enabling and disabling view model bindings when needed

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published