mercredi 31 août 2016

ember js get multiple checkbox value

My templates:

<form name="spam_list" >
    
    <tr>
        <td></td>
    </tr>
                           
<button >Check All</button>
</form>

My routes:

model(){
        // return 10 spams
    },

My controller:

actions:{
        spamDecide: function(model){
             var isCheck = model.getEach('isCheck');
             console.log(isCheck);
        },

        checkAll: function(model){
            var model = this.get('model');
            model.setEach('isCheck',true);
        },
    }

Currently action checkAll is work fine, set all checkbox into checked. My question is how can I know which checkbox is checked when I manually check them.
For example I set checkbox 1 5 7 is checked, then get the equivalent spam.id with each check?




Aucun commentaire:

Enregistrer un commentaire