Retrieving binding by ID

How can I retrieve a binding by ID?
Thanks,
Cage

Comments

  • Curious why you'd need to do this but it looks like you can call enyo.Binding.find(bindingId) assuming you've stored the binding's id previously.
  • Ah okay. Strange how I missed that whilst looking at enyo.Binding source code. I just created a hash to store the constructed binding objects but will try this instead.

    Basically, I have a view that goes through a model's attributes and creates UI controls for it. I bind the attribute values to UI control values in two way binding. When model is changed, I this.clearBindings() and then recreate new ones using this.binding() to represent the new model attributes. For simple components, the 2 way binding works fine; for complex controls (onyx.RadioGroup), I force a sync from target when a RadioButton is pressed and I need access to the binding to make that happen.
Sign In or Register to comment.