Commit 788d197a authored by Christian Hansen's avatar Christian Hansen Committed by Anton Koch
Browse files

Resolve "mb-table: remove required columns from "optional columns"-select field"

parent 316c112d
......@@ -12,9 +12,9 @@ div
table-below-top-module(
:visible-columns="visibleColumns"
:force-grid-mode="forceGridMode"
:columns-select="columnsSelect"
:options="options"
@filter="onFilter"
@columnSelect="onColumnSelectInput"
@options="onOptions"
@toggleMode="onToggleMode"
)
......@@ -178,10 +178,10 @@ div
// get related mb-dialog-overlay content
return `${this.$route.name.split('.')[1]}-overlay-content`
},
columnsSelect () {
// define columns for select field
options () {
// define options for optional columns
return this.columnsData.filter(column => {
return column.name !== 'actions' && column.name !== 'title'
return column.name !== 'actions' && !column.required
})
},
columnsData () {
......@@ -227,7 +227,7 @@ div
this.selected.row = obj
this.model.overlay = true
},
onColumnSelectInput (obj) {
onOptions (obj) {
// set visible columns
this.visibleColumns = obj
},
......
......@@ -29,16 +29,19 @@
v-if="!smallDevice || show.settings"
)
q-item-section(v-if="!smallDevice")
// leave it empty: space on desktop
q-item-section(:avatar="!smallDevice")
mb-select(
:options="columnsSelect"
:options="options"
:multiple="true",
:model="model.visibleColumns"
:option-value="'name'",
:display-value="$t('general.optional_columns')"
:class="{'full-width': forceGridMode}"
@input="onColumnSelectInput"
@input="onInput"
)
q-item-section.text-no-wrap(avatar)
div(v-if="!forceGridMode")
mb-icon-radio-btn(
......@@ -50,7 +53,7 @@
<script>
export default {
name: 'TableBelowTopModule',
props: ['visibleColumns', 'forceGridMode', 'columnsSelect'],
props: ['visibleColumns', 'forceGridMode', 'options'],
data () {
return {
filter: '',
......@@ -74,8 +77,8 @@
}
},
methods: {
onColumnSelectInput (val) {
this.$emit('columnSelect', val)
onInput (val) {
this.$emit('options', val)
},
toggleMode (val) {
this.$emit('toggleMode', val)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment