Fixed #912 - DataTable boolean shorthands do not work

pull/938/head
Cagatay Civici 2021-02-02 16:50:37 +03:00
parent 84569ecd37
commit a08b66db5a
8 changed files with 9 additions and 9 deletions

View File

@ -93,7 +93,7 @@ export default {
},
methods: {
columnProp(prop) {
return this.column.props ? this.column.props[prop] : null;
return this.column.props ? ((this.column.type.props[prop].type === Boolean && this.column.props[prop] === '') ? true : this.column.props[prop]) : null;
},
resolveFieldData() {
return ObjectUtils.resolveFieldData(this.rowData, this.columnProp('field'));

View File

@ -457,7 +457,7 @@ export default {
},
methods: {
columnProp(col, prop) {
return col.props ? col.props[prop] : null;
return col.props ? ((col.type.props[prop].type === Boolean && col.props[prop] === '') ? true : col.props[prop]) : null;
},
onPage(event) {
this.d_first = event.first;

View File

@ -127,7 +127,7 @@ export default {
},
methods: {
columnProp(col, prop) {
return col.props ? col.props[prop] : null;
return col.props ? ((col.type.props[prop].type === Boolean && col.props[prop] === '') ? true : col.props[prop]) : null;
},
onHeaderScroll() {
this.$refs.scrollHeader.scrollLeft = 0;

View File

@ -16,7 +16,7 @@
@mousedown="onRowMouseDown($event)" @dragstart="onRowDragStart($event, index)" @dragover="onRowDragOver($event,index)" @dragleave="onRowDragLeave($event)" @dragend="onRowDragEnd($event)" @drop="onRowDrop($event)">
<template v-for="(col,i) of columns">
<DTBodyCell v-if="shouldRenderBodyCell(value, col, index)" :key="columnProp(col,'columnKey')||columnProp(col,'field')||i" :rowData="rowData" :column="col" :index="index" :selected="isSelected(rowData)"
:rowTogglerIcon="columnProp(col,'expanded') ? rowTogglerIcon(rowData): null"
:rowTogglerIcon="columnProp(col,'expander') ? rowTogglerIcon(rowData): null"
:rowspan="rowGroupMode === 'rowspan' ? calculateRowGroupSize(value, col, index) : null"
:editMode="editMode" :editing="editMode === 'row' && isRowEditing(rowData)"
@radio-change="onRadioChange($event)" @checkbox-change="onCheckboxChange($event)" @row-toggle="onRowToggle($event)"
@ -152,7 +152,7 @@ export default {
},
methods: {
columnProp(col, prop) {
return col.props ? col.props[prop] : null;
return col.props ? ((col.type.props[prop].type === Boolean && col.props[prop] === '') ? true : col.props[prop]) : null;
},
shouldRenderRowGroupHeader(value, rowData, i) {
let currentRowFieldData = ObjectUtils.resolveFieldData(rowData, this.groupRowsBy);

View File

@ -33,7 +33,7 @@ export default {
},
methods: {
columnProp(col, prop) {
return col.props ? col.props[prop] : null;
return col.props ? ((col.type.props[prop].type === Boolean && col.props[prop] === '') ? true : col.props[prop]) : null;
}
},
computed: {

View File

@ -99,7 +99,7 @@ export default {
},
methods: {
columnProp(col, prop) {
return col.props ? col.props[prop] : null;
return col.props ? ((col.type.props[prop].type === Boolean && col.props[prop] === '') ? true : col.props[prop]) : null;
},
isMultiSorted(column) {
return this.columnProp(column, 'sortable') && this.getMultiSortMetaIndex(column) > -1

View File

@ -250,7 +250,7 @@ export default {
},
methods: {
columnProp(col, prop) {
return col.props ? col.props[prop] : null;
return col.props ? ((col.type.props[prop].type === Boolean && col.props[prop] === '') ? true : col.props[prop]) : null;
},
onNodeToggle(node) {
const key = node.key;

View File

@ -73,7 +73,7 @@ export default {
nodeTouched: false,
methods: {
columnProp(col, prop) {
return col.props ? col.props[prop] : null;
return col.props ? ((col.type.props[prop].type === Boolean && col.props[prop] === '') ? true : col.props[prop]) : null;
},
resolveFieldData(rowData, field) {
return ObjectUtils.resolveFieldData(rowData, field);