I am using ember CLI, emberjs 1.8.0 release and I am trying to build a dynamic view. As per various reference and suggestions on the web. I planned to use ContainerView and ChildViews as, I have to dynamically add some textfields on every click of ADD button
on my main view.
I am able to add the childViews in the containerView. However I am facing issue with data retrival. I am not able to get data in my controller. Data which i have entered in the each child view. I think because controller and ContainerView has not direct relation.
Here is the JSBin of what I am doing
I want to get value of all the dynamically added WIDTH fields
I hope you have seen the attached jsbin, In that I have shown that i am adding multiple child to containerView and those child have one Textfield in which user can enter Data.
Now in controller I want to get that Textfield value.
Thank you for the reply
Yes I want the similar functionality which you have explained above.
I saw the JSBIN which you have created unfortunately when I click GetWidth I am not getting
dynamically added with.
I just see 1,2,3, as I added 5-6 textboxes and added value to those.
I would like to get value of added all dynamic fields in controller. Also in my case I am having little more complex design. Where when user click on add row i will add one row with four textbox and so on,
@jasonmit, my understanding is that Ember.View is going away at some point in the near future. How would we implement something like this in an Ember.View-less world?
This is one of the more frustrating aspects about Ember: Current devs who are “in the know” talking about certain features being deprecated soon and warn new comers not to use them but fail to concisely offer proper alternatives or “better” practices to future-proof current code. Any insight on that would be appreciated.
The index view and controller would be come the “index” component. The story on how the router will create these components instead of views would require some work on the router’s renderTemplate hook (among various other places).
But honestly, I wouldn’t start building software today with this future goal in mind – Ember.View will be around for a long time. It’s not something they plan to deprecate and immediately make obsolete. It will be incremental and there will be a migration path.
Wait, I might have misunderstood this- is it actually the plan to move away from views? I know that controllers are either going to get rolled into routeable components or split off into services, but why get rid of custom views? You can use components to accomplish all the same stuff that views do, but they’re kind of overkill for something like a click handler. That would also give us routeable components, application-reusable components, and generally reusable components. I’m getting uncomfortable with how overloaded that word is getting. Do we need to throw out the architecture baby with the hard-to-learn bathwater?