Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>From what the Getting Started part of the guides say, you should use the {{input}} helper instead of a custom view <a href="http://emberjs.com/guides/getting-started/marking-a-model-as-complete-incomplete/">http://emberjs.com/guides/getting-started/marking-a-model-as-complete-incomplete/</a>). It should look like this:</p> <pre><code>&lt;td&gt;{{input type="text" value=parameter.value}}&lt;/td&gt; </code></pre> <p>The controller knows which record is where, that's why it can "magically" make the link between an input HTML element and its corresponding record's value.</p> <p>Now for the focusOut part, I would use the {{action}} helper on the td to catch the event (read this for the types of event: <a href="http://emberjs.com/guides/templates/actions/#toc_specifying-the-type-of-event">http://emberjs.com/guides/templates/actions/#toc_specifying-the-type-of-event</a>) , like so:</p> <pre><code>&lt;td {{action "focusOut" parameter on="focusOut"&gt;{{input type="text" value=parameter.value}}&lt;/td&gt; </code></pre> <p>The "focusOut" action has to be set up in your controller, parameter is the model you send to the function and on="focusOut" is the event the action responds to. The benefit of sending the parameter to the action "focusOut" is that in the focusOut action of your controller you can simply call:</p> <pre><code>---- controller code ---- focusOut: function(model){ model.save(); } ---- controller code ---- </code></pre> <p>That's if you're using Ember-Data, the store knows about your model and the adapter to use so you can just call save (it's in the Ember-Data API, under the DS.Model class).</p> <p>Since I'm only using FIXTURES for now, I can't really say anything about Adapters but you can take a look at the Models part of the guides, it might help you.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload