Created
May 16, 2011 18:17
-
-
Save MikailCliftov/974993 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MyApp.aSimpleController= SC.ObjectController.create({ | |
contentBinding : SC.Binding.single('MyApp.anArrayController.selection') | |
}); | |
MyApp.anotherArrayController= SC.ArrayController.create({ | |
abcBinding: 'MyApp.aSimpleController.content', | |
xyzBinding: SC.Binding.oneWay('MyApp.anotherObjectController.content'), | |
observeMe: function(){ | |
var abc= this.get('abc'); | |
var xyz= this.get('xyz'); | |
if (abc && xyz ){ | |
console.log('abc: '+abc); | |
console.log('xyz: '+xyz); | |
console.log('abc should be: '+ MyApp.anArrayController.get('selection').firstObject); | |
} | |
}.observes('abc', 'xyz') | |
}); | |
'abc' seems to lag behind. | |
In some situations when abc should be undefined, it is set to the previous value; | |
output: | |
abc: MyApp.bla bla | |
xyz: MyApp.bla bla | |
abc should be: MyApp.bla bla | |
//selection set is changed to empty | |
abc: MyApp.bla bla | |
xyz: MyApp.bla bla | |
abc should be: undefined | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment