Fixed #216 - sortfield is ignored

pull/227/head
cagataycivici 2020-03-03 12:14:30 +03:00
parent ed55681530
commit 12a4d2a930
1 changed files with 2 additions and 1 deletions

View File

@ -465,7 +465,7 @@ export default {
if (column.sortable) {
const targetNode = event.target;
const columnField = column.field || column.sortField;
const columnField = column.sortField || column.field;
if (DomHandler.hasClass(targetNode, 'p-sortable-column') || DomHandler.hasClass(targetNode, 'p-column-title')
|| DomHandler.hasClass(targetNode, 'p-sortable-column-icon') || DomHandler.hasClass(targetNode.parentElement, 'p-sortable-column-icon')) {
@ -499,6 +499,7 @@ export default {
data.sort((data1, data2) => {
let value1 = ObjectUtils.resolveFieldData(data1, this.d_sortField);
let value2 = ObjectUtils.resolveFieldData(data2, this.d_sortField);
let result = null;
if (value1 == null && value2 != null)