mardi 16 février 2016

Ember.js input checkbox in table

I have lots of models and show them in tables. When user needs to do something with several models, we need to give him ability to choose rows.

How can I implement it with checkboxes? Of course I don't want to create special field on my models for every table.

This is simple example. http://ift.tt/1U5ju2T

My tries were:

{{input type='checkbox' checked=model.someNotExistedField}} 

But in this case input just doesnt work.

And:

<input type="checkbox" {{action marked model}}  checked={{in-arr record selectedItems}} />

In second example I've tried to keep selected ids in an array on context. But id doesnt work too.




Aucun commentaire:

Enregistrer un commentaire