Search code examples
sproutcoresproutcore-viewssproutcore-controllers

How to accomplish a optional childview?


I have a view with two child views, and want the second view optionally to disappear, that is disabled including the dataBinding, and resize the first view, and vice versa. I need some hints or (pseudo) code how to accomplish this. Thx in advance.


Solution

  • There are quite a few views in SproutCore which do this in some way or another. While it is not the best example, have a look at the experimental select search view.

    You are going to need to override createChildViews to set up the bindings manually, so you can also take them down when required.