Skip to content

Commit ef6f03d

Browse files
timefordroidsDenis Korablev
authored andcommitted
call sortChange on th click
1 parent 5d272eb commit ef6f03d

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

packages/ve-table/src/header/header-th.jsx

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,19 @@ export default {
165165
}
166166
}
167167

168+
return result;
169+
},
170+
// is sortable column
171+
isSortableCloumn() {
172+
let result = false;
173+
174+
const { sortColumns, groupColumnItem } = this;
175+
const currentField = groupColumnItem.field;
176+
177+
if (Object.keys(sortColumns).includes(currentField)) {
178+
result = true;
179+
}
180+
168181
return result;
169182
},
170183
},
@@ -183,6 +196,7 @@ export default {
183196
[clsName("first-right-fixed-column")]:
184197
this.isfirstRightFixedColumn,
185198
[clsName("last-column")]: this.isLastCloumn,
199+
[clsName("sortable-column")]: this.isSortableCloumn,
186200
};
187201

188202
const {
@@ -378,9 +392,6 @@ export default {
378392

379393
const props = {
380394
class: clsName("sort"),
381-
on: {
382-
click: () => this.sortChange(),
383-
},
384395
};
385396

386397
result = (
@@ -592,6 +603,10 @@ export default {
592603
const events = {
593604
click: (e) => {
594605
this.cellClick(e, click);
606+
607+
if (this.isSortableCloumn) {
608+
this.sortChange();
609+
}
595610
},
596611
dblclick: (e) => {
597612
this.cellDblclick(e, dblclick);

0 commit comments

Comments
 (0)