diff --git a/src/components/datatable/DataTable.vue b/src/components/datatable/DataTable.vue index 0f1d182c7..8b166ad76 100755 --- a/src/components/datatable/DataTable.vue +++ b/src/components/datatable/DataTable.vue @@ -768,7 +768,7 @@ export default { findNextSelectableRow(row) { let nextRow = row.nextElementSibling; if (nextRow) { - if (DomHandler.hasClass(nextRow, 'p-datatable-row')) + if (DomHandler.hasClass(nextRow, 'p-selectable-row')) return nextRow; else return this.findNextSelectableRow(nextRow); @@ -780,7 +780,7 @@ export default { findPrevSelectableRow(row) { let prevRow = row.previousElementSibling; if (prevRow) { - if (DomHandler.hasClass(prevRow, 'p-datatable-row')) + if (DomHandler.hasClass(prevRow, 'p-selectable-row')) return prevRow; else return this.findPrevSelectableRow(prevRow); @@ -1862,7 +1862,7 @@ export default { table-layout: auto; } -.p-datatable-hoverable-rows .p-datatable-row { +.p-datatable-hoverable-rows .p-selectable-row { cursor: pointer; } diff --git a/src/components/datatable/TableBody.vue b/src/components/datatable/TableBody.vue index f34b9cc23..d941fba54 100755 --- a/src/components/datatable/TableBody.vue +++ b/src/components/datatable/TableBody.vue @@ -205,7 +205,11 @@ export default { return this.dataKey ? ObjectUtils.resolveFieldData(rowData, this.dataKey): index; }, getRowClass(rowData) { - let rowStyleClass = ['p-datatable-row']; + let rowStyleClass = []; + if (this.selectionMode) { + rowStyleClass.push('p-selectable-row'); + } + if (this.selection) { rowStyleClass.push({ 'p-highlight': this.isSelected(rowData)