Skip to content
This repository has been archived by the owner on Jan 3, 2024. It is now read-only.

Commit

Permalink
add possibility of callback for option None
Browse files Browse the repository at this point in the history
  • Loading branch information
elizavetaRa committed Feb 22, 2022
1 parent 65f43b6 commit 12c582b
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/components/molecules/OcTable/OcTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@
<div class="oc-docs-width-medium" style="display: inline-block; width: 250px">
<oc-select
v-model="selected"
:options="Object.keys(groupingSettings.groupingFunctions)"
:options="[
...Object.keys(groupingSettings.groupingFunctions),
!Object.keys(groupingSettings.groupingFunctions).includes('None') ? 'None' : '',
]"
:clearable="false"
:searchable="false"
/>
Expand Down Expand Up @@ -410,6 +413,18 @@ export default {
return result
},
},
watch: {
//callback for selection of None by enabled groupingSettings
selected: function () {
if (
this.selected === "None" &&
this.groupingSettings &&
this.groupingSettings.groupingFunctions &&
this.groupingSettings.groupingFunctions["None"]
)
this.groupingSettings.groupingFunctions["None"]()
},
},
mounted() {
//create copy of array to manipulate toggling
Expand Down

0 comments on commit 12c582b

Please sign in to comment.