sproutcore-2

Are Recursive Collections possible in sproutcore2?

☆樱花仙子☆ 提交于 2019-12-24 00:57:02
问题 I have a customizable navigation tree that can be nested 3 levels deep. Templates: <script type="text/x-handlebars" data-template-name="NavItemView"> <a {{bindAttr href="href" class="content.className"}}>{{content.name}}</a> {{##if content.children}} another collection here? {{/if}} </script> <script type="text/x-handlebars"> {{collection App.NavItemsCollectionView contentBinding="App.navItemsController" tagName="ul"}} {{view App.CreateLinkView id="new-link" placeholder="Name"}} </script>

Ember.js dynamic child views

泄露秘密 提交于 2019-12-10 10:05:13
问题 I'm having trouble getting ember to render a dynamic child view. It seems that once the child view is rendered, the binding is lost. Here's a jsfiddle http://jsfiddle.net/zaius/XYzfa/ As you click between the two editor pages, the child view remains on the first view that was rendered. Is there a way to tell ember to refresh the view, or am I going about this completely the wrong way? I'm brand new to ember, so any general feedback on my code is welcome too. 回答1: You should consider using

Ember.js dynamic child views

随声附和 提交于 2019-12-05 21:20:30
I'm having trouble getting ember to render a dynamic child view. It seems that once the child view is rendered, the binding is lost. Here's a jsfiddle http://jsfiddle.net/zaius/XYzfa/ As you click between the two editor pages, the child view remains on the first view that was rendered. Is there a way to tell ember to refresh the view, or am I going about this completely the wrong way? I'm brand new to ember, so any general feedback on my code is welcome too. You should consider using Ember.ContainerView (see documentation ) for such dynamic content. Illustrating JSFiddle here (I also

Writing custom controls in Sproutcore 2

北城以北 提交于 2019-12-04 13:36:55
I'm fairly new to Sproutcore, but I am familiar with Handlebars. I have walked through the Todo tutorial and checked out a few other samples as well. I love everything about it and would like to use it over Backbone, but I am having a hard time understanding how to wire up custom controls. I can see where some of the data will play into the bindings, but triggering events I get lost in. As an example, if I had a link list that I would like to use to filter data below it, how to do I tie into the events? I know in backbone you would use the event and selector: "click .link" Any help would be