Fixed #1646 - Kebab-case properties are not working on DataTable and TreeTable

pull/1664/head
mertsincan 2021-10-07 09:26:26 +03:00
parent 5c48a12347
commit 306b38ef5d
6 changed files with 10 additions and 8 deletions

View File

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

View File

@ -193,7 +193,7 @@ export default {
},
methods: {
columnProp(col, prop) {
return col.props ? ((col.type.props[prop].type === Boolean && col.props[prop] === '') ? true : col.props[prop]) : null;
return ObjectUtils.getVNodeProp(col, prop);
},
shouldRenderRowGroupHeader(value, rowData, i) {
let currentRowFieldData = ObjectUtils.resolveFieldData(rowData, this.groupRowsBy);

View File

@ -17,6 +17,7 @@
<script>
import FooterCell from './FooterCell.vue';
import {ObjectUtils} from 'primevue/utils';
export default {
name: 'TableFooter',
@ -32,7 +33,7 @@ export default {
},
methods: {
columnProp(col, prop) {
return col.props ? ((col.type.props[prop].type === Boolean && col.props[prop] === '') ? true : col.props[prop]) : null;
return ObjectUtils.getVNodeProp(col, prop);
}
},
computed: {

View File

@ -51,6 +51,7 @@
import HeaderCell from './HeaderCell.vue';
import HeaderCheckbox from './HeaderCheckbox.vue';
import ColumnFilter from './ColumnFilter.vue';
import {ObjectUtils} from 'primevue/utils';
export default {
name: 'TableHeader',
@ -121,7 +122,7 @@ export default {
},
methods: {
columnProp(col, prop) {
return col.props ? ((col.type.props[prop].type === Boolean && col.props[prop] === '') ? true : col.props[prop]) : null;
return ObjectUtils.getVNodeProp(col, prop);
},
getFilterColumnHeaderClass(column) {
return ['p-filter-column', this.columnProp(column, 'filterHeaderClass'), this.columnProp(column, 'class'), {

View File

@ -280,7 +280,7 @@ export default {
},
methods: {
columnProp(col, prop) {
return col.props ? ((col.type.props[prop].type === Boolean && col.props[prop] === '') ? true : col.props[prop]) : null;
return ObjectUtils.getVNodeProp(col, prop);
},
onNodeToggle(node) {
const key = node.key;
@ -693,7 +693,7 @@ export default {
else if (this.columnResizeMode === 'expand') {
this.$refs.table.style.width = this.$refs.table.offsetWidth + delta + 'px';
if (!this.scrollable)
if (!this.scrollable)
this.resizeColumnElement.style.width = newColumnWidth + 'px';
else
this.resizeTableCells(newColumnWidth);

View File

@ -15,7 +15,7 @@
</template>
<script>
import {DomHandler} from 'primevue/utils';
import {DomHandler, ObjectUtils} from 'primevue/utils';
import BodyCell from './BodyCell.vue';
export default {
@ -58,7 +58,7 @@ export default {
nodeTouched: false,
methods: {
columnProp(col, prop) {
return col.props ? ((col.type.props[prop].type === Boolean && col.props[prop] === '') ? true : col.props[prop]) : null;
return ObjectUtils.getVNodeProp(col, prop);
},
toggle() {
this.$emit('node-toggle', this.node);