PDA

View Full Version : viewModel.bind only called one time



SebTardif
10 Oct 2014, 11:31 AM
Extract from: http://docs.sencha.com/extjs/5.0.1/#!/api/Ext.app.ViewModel-method-bind


bind (http://docs.sencha.com/extjs/5.0.1/#!/api/Ext.app.ViewModel-method-bind)( descriptor, callback, [scope], [options] ) : Ext.app.bind.BaseBinding (http://docs.sencha.com/extjs/5.0.1/#!/api/Ext.app.bind.BaseBinding)/Ext.app.bind.Binding (http://docs.sencha.com/extjs/5.0.1/#!/api/Ext.app.bind.Binding)
This method requests that data in this ViewModel be delivered to the specified callback. The data desired is given in a "bind descriptor" which is the first argument.




You can see in this Fiddle example that the function will be only called one time, then never called again when you keep alternating "code" to true <--> false.

https://fiddle.sencha.com/#fiddle/bl7

nikolay.bobrovskiy
10 Oct 2014, 10:26 PM
First of all you bind to view model of container that does not have radioValue. Secondly bindable value should be surrounded by {}.
One of variants to get it working: https://fiddle.sencha.com/#fiddle/blk
But that's not good because depends on radio group reference name in hoster.