javascript - backbone collection get list of single attributes -
i wanting list collection, list used add together options select list. wanting utilize filter collection,
so illustration want filter collection grouping attributes, first need distinct groups collection, i.e no repeats, know can like,
this.collection.where({ group: "group name"});
but there way homecoming list of attributes models in collection without having query key word?
what want in end this,
<select> <option>filter group</option> <option value="organisation 1">organisation 1</option> <option value="toms organisation">tom's organisation</option> <option value="acme">acme</option> </select> is possible?
i think need pluck() collection method _.uniq() underscore method:
_.uniq(this.collection.pluck('group')) javascript backbone.js backbone-collections backbone-model
No comments:
Post a Comment