Fixed #4306 - DataTable: PT Options missing for Expansion Row Cell

pull/4343/head
Tuğçe Küçükoğlu 2023-08-24 13:29:52 +03:00
parent 14a1ed5c01
commit bb12c9e724
2 changed files with 5 additions and 6 deletions

View File

@ -470,7 +470,7 @@ export default {
self, self,
globalPT, globalPT,
key !== 'transition' && { key !== 'transition' && {
...(key === 'root' && { [`${datasetPrefix}name`]: ObjectUtils.toFlatCase(this.$.type.name) }), ...(key === 'root' && this.$.type.name === this.$options.hostName && { [`${datasetPrefix}name`]: ObjectUtils.toFlatCase(this.$.type.name) }),
[`${datasetPrefix}section`]: ObjectUtils.toFlatCase(key) [`${datasetPrefix}section`]: ObjectUtils.toFlatCase(key)
} }
); );

View File

@ -10,7 +10,7 @@
role="row" role="row"
v-bind="ptm('rowGroupHeader')" v-bind="ptm('rowGroupHeader')"
> >
<td :colspan="columnsLength - 1" v-bind="{ ...ptm('column.root'), ...ptm('column.bodyCell') }" data-pc-section="bodycell"> <td :colspan="columnsLength - 1" v-bind="{ ...getColumnPT('root'), ...getColumnPT('bodyCell') }" data-pc-section="bodycell">
<button v-if="expandableRowGroups" :class="cx('rowGroupToggler')" @click="onRowGroupToggle($event, rowData)" type="button" v-bind="ptm('rowGroupToggler')"> <button v-if="expandableRowGroups" :class="cx('rowGroupToggler')" @click="onRowGroupToggle($event, rowData)" type="button" v-bind="ptm('rowGroupToggler')">
<component v-if="templates['rowgrouptogglericon']" :is="templates['rowgrouptogglericon']" :expanded="isRowGroupExpanded(rowData)" /> <component v-if="templates['rowgrouptogglericon']" :is="templates['rowgrouptogglericon']" :expanded="isRowGroupExpanded(rowData)" />
<template v-else> <template v-else>
@ -102,7 +102,7 @@
role="row" role="row"
v-bind="ptm('rowGroupFooter')" v-bind="ptm('rowGroupFooter')"
> >
<td :colspan="columnsLength - 1" v-bind="{ ...ptm('column.root'), ...ptm('column.footerCell') }" data-pc-section="footercell"> <td :colspan="columnsLength - 1" v-bind="{ ...getColumnPT('root'), ...getColumnPT('footerCell') }" data-pc-section="footercell">
<component :is="templates['groupfooter']" :data="rowData" :index="getRowIndex(index)" /> <component :is="templates['groupfooter']" :data="rowData" :index="getRowIndex(index)" />
</td> </td>
</tr> </tr>
@ -307,16 +307,15 @@ export default {
columnProp(col, prop) { columnProp(col, prop) {
return ObjectUtils.getVNodeProp(col, prop); return ObjectUtils.getVNodeProp(col, prop);
}, },
getColumnPT(currentColumn, key) { getColumnPT(key) {
const columnMetaData = { const columnMetaData = {
props: currentColumn.props,
parent: { parent: {
props: this.$props, props: this.$props,
state: this.$data state: this.$data
} }
}; };
return mergeProps(this.ptm(`column.${key}`, { column: columnMetaData }), this.ptm(`column.${key}`, columnMetaData), this.ptmo(this.getColumnProp(currentColumn), key, columnMetaData)); return mergeProps(this.ptm(`column.${key}`, { column: columnMetaData }), this.ptm(`column.${key}`, columnMetaData), this.ptmo(this.getColumnProp({}), key, columnMetaData));
}, },
getColumnProp(column) { getColumnProp(column) {
return column.props && column.props.pt ? column.props.pt : undefined; //@todo return column.props && column.props.pt ? column.props.pt : undefined; //@todo