Refactor #5196
parent
3a89a10fd5
commit
30c20d4e8a
|
@ -479,6 +479,7 @@ export default {
|
||||||
},
|
},
|
||||||
rowClasses() {
|
rowClasses() {
|
||||||
let rowStyleClass = [];
|
let rowStyleClass = [];
|
||||||
|
let columnSelectionMode = null;
|
||||||
|
|
||||||
if (this.rowClass) {
|
if (this.rowClass) {
|
||||||
let rowClassValue = this.rowClass(this.rowData);
|
let rowClassValue = this.rowClass(this.rowData);
|
||||||
|
@ -488,7 +489,18 @@ export default {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return [this.cx('row', { rowData: this.rowData, index: this.rowIndex }), rowStyleClass];
|
if (this.columns) {
|
||||||
|
for (let col of this.columns) {
|
||||||
|
let _selectionMode = this.columnProp(col, 'selectionMode');
|
||||||
|
|
||||||
|
if (ObjectUtils.isNotEmpty(_selectionMode) && _selectionMode === 'multiple') {
|
||||||
|
columnSelectionMode = _selectionMode;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return [this.cx('row', { rowData: this.rowData, index: this.rowIndex, columnSelectionMode }), rowStyleClass];
|
||||||
},
|
},
|
||||||
rowTabindex() {
|
rowTabindex() {
|
||||||
if (this.selection === null && (this.selectionMode === 'single' || this.selectionMode === 'multiple')) {
|
if (this.selection === null && (this.selectionMode === 'single' || this.selectionMode === 'multiple')) {
|
||||||
|
|
|
@ -350,7 +350,7 @@ const classes = {
|
||||||
rowgroupHeader: 'p-rowgroup-header',
|
rowgroupHeader: 'p-rowgroup-header',
|
||||||
rowGroupToggler: 'p-row-toggler p-link',
|
rowGroupToggler: 'p-row-toggler p-link',
|
||||||
rowGroupTogglerIcon: 'p-row-toggler-icon',
|
rowGroupTogglerIcon: 'p-row-toggler-icon',
|
||||||
row: ({ instance, props, index }) => {
|
row: ({ instance, props, index, columnSelectionMode }) => {
|
||||||
let rowStyleClass = [];
|
let rowStyleClass = [];
|
||||||
|
|
||||||
if (props.selectionMode) {
|
if (props.selectionMode) {
|
||||||
|
@ -358,9 +358,8 @@ const classes = {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (props.selection) {
|
if (props.selection) {
|
||||||
console.log(props.selectionMode);
|
|
||||||
rowStyleClass.push({
|
rowStyleClass.push({
|
||||||
'p-highlight': props.selectionMode === 'multiple' || props.selectionMode === 'single' ? instance.isSelected : instance.isSelected && instance.$parentInstance.$parentInstance.highlightOnSelect
|
'p-highlight': columnSelectionMode ? instance.isSelected && instance.$parentInstance.$parentInstance.highlightOnSelect : instance.isSelected
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue