Allowing groups on select2 component
This commit is contained in:
1 parent
0f30648646
commit
150817d711
1 file changed
+13
-3
@@ -8,11 +8,21 @@
|
|||||||
{{this.tagAttributes}}
|
{{this.tagAttributes}}
|
||||||
>
|
>
|
||||||
{{>UI.contentBlock}}
|
{{>UI.contentBlock}}
|
||||||
{{#each item in (reactive this.items)}}
|
{{>baseSelectOptions this.items}}
|
||||||
|
</select>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<template name="baseSelectOptions">
|
||||||
|
{{#each item in (reactive this)}}
|
||||||
|
{{#if item.items}}
|
||||||
|
<optgroup label="{{item.label}}">
|
||||||
|
{{>baseSelectOptions item.items}}
|
||||||
|
</optgroup>
|
||||||
|
{{else}}
|
||||||
<option
|
<option
|
||||||
value="{{item.value}}"
|
value="{{item.value}}"
|
||||||
selected="{{#if eq item.value (reactive this.value)}}selected{{/if}}"
|
selected="{{#if eq item.value (reactive this.value)}}selected{{/if}}"
|
||||||
>{{item.label}}</option>
|
>{{item.label}}</option>
|
||||||
{{/each}}
|
{{/if}}
|
||||||
</select>
|
{{/each}}
|
||||||
</template>
|
</template>
|
||||||
Reference in new issue
Block a user