Results 1 to 2 of 2

Thread: Bind to another ViewModel

  1. #1
    Sencha Premium Member
    Join Date
    Apr 2014
    Posts
    29

    Default Answered: Bind to another ViewModel

    Hey,

    how is it possible to bind data to another ViewModel?

    PHP Code:
    {
                
    region'center',
                
    xtype'panel',
                
    bind: {
                    
    title'{testtext}',  //works
                    
    viewModel: {
                        
    data: {
                            
    testtest'{testtext}' //doesn't work
                        
    }
                    }

                },
            } 
    Or is there a other way to transfer data from a ViewModel to others?

  2. Hi,

    There's not a mechanism in place to bind to other viewmodels outside of the component's hierarchy. If the data is in an ancestor viewmodel then that data is passed down over JS prototype inheritance from ancestor viewmodels down through the component chain (with any data nodes existing on the lower viewmodels superceding same-named nodes from inherited viewmodels).

  3. #2
    Sencha User
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    6,165
    Answers
    505

    Default

    Hi,

    There's not a mechanism in place to bind to other viewmodels outside of the component's hierarchy. If the data is in an ancestor viewmodel then that data is passed down over JS prototype inheritance from ancestor viewmodels down through the component chain (with any data nodes existing on the lower viewmodels superceding same-named nodes from inherited viewmodels).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •