javascript - Selecting dynamically created checkboxes in Ember JS -
hi pulling data server side model , populating them via checkbox. how user selection checkbox? understand this.get('ischecked')
can me value of checkbox how do in user case since variable number of checkboxes populated dynamically?
note:i not using ember data , populating model via ember.$.json() call server api router class.
i tried following examples given here dynamically create inputs ember (and retrieve values) , here emberjs - checkboxes , getting values in controller none of them seem working me.
brand model has checked boolean attribute selected false default.
{{#each brand in model}} <div class="col-lg-2 col-xs-4"> <div class="brand-select-image-container"> {{input type="checkbox" name=brand.brand_name checked=brand.checked class="brand-select-checkbox" }} <img src="http://localhost:3000{{brand.img_location}}" class="brand-select-image"/> </div> <p class="brand-select-name">{{brand.brand_name}}</p> </div> {{/each}}
ok fixed else who's having tough time figuring out how make ember checkboxes work
this.get('model').foreach(function(item){ console.log(item.checked); });
Comments
Post a Comment