Fixed #82 - Add row-click event to Table
parent
0803bac20a
commit
b27169098e
|
@ -616,19 +616,21 @@ export default {
|
||||||
},
|
},
|
||||||
onRowClick(e) {
|
onRowClick(e) {
|
||||||
const event = e.originalEvent;
|
const event = e.originalEvent;
|
||||||
const rowData = e.data;
|
const target = event.target;
|
||||||
const rowIndex = e.index;
|
const targetNode = target.nodeName;
|
||||||
|
const parentNode = target.parentElement && target.parentElement.nodeName;
|
||||||
|
|
||||||
|
if (targetNode == 'INPUT' || targetNode == 'BUTTON' || targetNode == 'A' ||
|
||||||
|
parentNode == 'INPUT' || parentNode == 'BUTTON' || parentNode == 'A' ||
|
||||||
|
(DomHandler.hasClass(target, 'p-clickable'))) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.$emit('row-click', event);
|
||||||
|
|
||||||
if (this.selectionMode) {
|
if (this.selectionMode) {
|
||||||
let target = event.target;
|
const rowData = e.data;
|
||||||
let targetNode = target.nodeName;
|
const rowIndex = e.index;
|
||||||
let parentNode = target.parentElement && target.parentElement.nodeName;
|
|
||||||
|
|
||||||
if (targetNode == 'INPUT' || targetNode == 'BUTTON' || targetNode == 'A' ||
|
|
||||||
parentNode == 'INPUT' || parentNode == 'BUTTON' || parentNode == 'A' ||
|
|
||||||
(DomHandler.hasClass(target, 'p-clickable'))) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.isMultipleSelectionMode() && event.shiftKey && this.anchorRowIndex != null) {
|
if (this.isMultipleSelectionMode() && event.shiftKey && this.anchorRowIndex != null) {
|
||||||
DomHandler.clearSelection();
|
DomHandler.clearSelection();
|
||||||
|
|
Loading…
Reference in New Issue