Results 1 to 3 of 3

Thread: Deep binding not working

  1. #1
    Sencha User
    Join Date
    Mar 2013
    Location
    California
    Posts
    49

    Default Answered: Deep binding not working

    Code:
            viewModel.bind({bindTo: '{myObj}', deep: true}, function(data) {
                console.log('bind called with ' + data);
            });
    
    
            var myObj = {
                name: 'name1'
            }
    
    
            viewModel.set('myObj', myObj);
            viewModel.notify();
    
    
            viewModel.set('myObj.name', 'name2')
            viewModel.notify();
    The second viewModel.set() call does not trigger the bind callback for me. I thought "deep: true" would trigger it for any properties. Or, am I doing something wrong?

  2. deep: true had a bug in the beta that prevented it from being read as an option.

    In the interim you can set .deep on the binding:

    Code:
    viewModel.bind('{myObj}', fn).deep = true;

  3. #2
    Sencha Premium User evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    19,256
    Answers
    759

    Default

    deep: true had a bug in the beta that prevented it from being read as an option.

    In the interim you can set .deep on the binding:

    Code:
    viewModel.bind('{myObj}', fn).deep = true;
    Twitter - @evantrimboli
    Former Sencha framework engineer, available for consulting.
    As of 2017-09-22 I am not employed by Sencha, all subsequent posts are my own and do not represent Sencha in any way.

  4. #3
    Sencha User
    Join Date
    Mar 2013
    Location
    California
    Posts
    49

    Default

    It works, thanks!

Posting Permissions

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