pull/5206/head
tugcekucukoglu 2024-02-02 23:17:35 +03:00
parent 3a89a10fd5
commit 30c20d4e8a
2 changed files with 15 additions and 4 deletions

View File

@ -479,6 +479,7 @@ export default {
},
rowClasses() {
let rowStyleClass = [];
let columnSelectionMode = null;
if (this.rowClass) {
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() {
if (this.selection === null && (this.selectionMode === 'single' || this.selectionMode === 'multiple')) {

View File

@ -350,7 +350,7 @@ const classes = {
rowgroupHeader: 'p-rowgroup-header',
rowGroupToggler: 'p-row-toggler p-link',
rowGroupTogglerIcon: 'p-row-toggler-icon',
row: ({ instance, props, index }) => {
row: ({ instance, props, index, columnSelectionMode }) => {
let rowStyleClass = [];
if (props.selectionMode) {
@ -358,9 +358,8 @@ const classes = {
}
if (props.selection) {
console.log(props.selectionMode);
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
});
}