Add characteristics. Select All blocks for way too long.
This commit is contained in:
parent
a4fc06d22d
commit
6f15bc940d
2 changed files with 13 additions and 9 deletions
|
@ -20,7 +20,7 @@ export default Component.extend({
|
||||||
|
|
||||||
updateCharacteristics: function(selection) {
|
updateCharacteristics: function(selection) {
|
||||||
this.set('selectedCharacteristics', selection);
|
this.set('selectedCharacteristics', selection);
|
||||||
this.attrs['update-characteristics'](this.get('selectedCharacteristics'));
|
this.attrs['update-characteristics'](selection);
|
||||||
},
|
},
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
|
@ -51,15 +51,19 @@ export default Component.extend({
|
||||||
chars.forEach((char) => {
|
chars.forEach((char) => {
|
||||||
char_ids.push(char.get('id'));
|
char_ids.push(char.get('id'));
|
||||||
});
|
});
|
||||||
this.updateCharacteristics(char_ids.join(","));
|
this.updateCharacteristics(char_ids);
|
||||||
},
|
},
|
||||||
|
|
||||||
deselectAllCharacteristics: function() {
|
deselectAllCharacteristics: function() {
|
||||||
this.updateCharacteristics("");
|
this.updateCharacteristics([]);
|
||||||
},
|
},
|
||||||
|
|
||||||
updateStrainSelection: function(selection) {
|
updateStrainSelection: function(selection) {
|
||||||
this.updateStrains(selection);
|
this.updateStrains(selection);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
updateCharacteristicSelection: function(selection) {
|
||||||
|
this.updateCharacteristics(selection);
|
||||||
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
|
@ -25,13 +25,13 @@
|
||||||
<li>
|
<li>
|
||||||
<label>Characteristics</label>
|
<label>Characteristics</label>
|
||||||
{{
|
{{
|
||||||
select-2
|
x-select
|
||||||
|
listItems=characteristics
|
||||||
|
nameAttr="characteristicName"
|
||||||
|
update=(action "updateCharacteristicSelection")
|
||||||
|
placeholder="Select one ore more characteristics"
|
||||||
multiple=true
|
multiple=true
|
||||||
content=characteristics
|
selected=selectedCharacteristics
|
||||||
value=selectedCharacteristics
|
|
||||||
optionValuePath="id"
|
|
||||||
optionLabelPath="characteristicName"
|
|
||||||
placeholder="Select one or more characteristics"
|
|
||||||
}}
|
}}
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
|
|
Reference in a new issue