Fixed #397 - Rename p-datatable-row to p-selectable-row

pull/411/head
cagataycivici 2020-07-18 14:31:49 +03:00
parent 6fb69df249
commit 9a9dd68b05
2 changed files with 8 additions and 4 deletions

View File

@ -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;
}

View File

@ -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)