-
-
Notifications
You must be signed in to change notification settings - Fork 119
feat(sorting): add "Clear Sort" in each Column Header Menu #94
Conversation
if (grid && dataView) { | ||
if (forceReSort) { | ||
this._dataView.reSort(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be dataView
instead of this._dataView
@@ -2,6 +2,7 @@ export class Constants { | |||
static TEXT_CANCEL = 'Cancel'; | |||
static TEXT_CLEAR_ALL_FILTERS = 'Clear All Filters'; | |||
static TEXT_CLEAR_ALL_SORTING = 'Clear All Sorting'; | |||
static TEXT_CLEAR_SORT = 'Clear Sort'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change to TEXT_REMOVE_SORT
and update text
src/assets/i18n/en.json
Outdated
@@ -3,6 +3,7 @@ | |||
"CANCEL": "Cancel", | |||
"CLEAR_ALL_FILTERS": "Clear All Filters", | |||
"CLEAR_ALL_SORTING": "Clear All Sorting", | |||
"CLEAR_SORT": "Clear Sort", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change to REMOVE_SORT
and update text
/** Sort the current column */ | ||
private sortColumn(e: Event, args: HeaderMenuOnCommandArgs, isSortingAsc = true) { | ||
// get previously sorted columns | ||
const cols: ColumnSort[] = this.sortService.getPreviousColumnSorts(args.column.id + ''); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename cols
to sortedColsWithoutCurrent
|
||
/** Clear the Sort on the current column (if it's actually sorted) */ | ||
private clearColumnSort(e: Event, args: HeaderMenuOnCommandArgs) { | ||
// get previously sorted columns |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add if condition
if (args && args.column) {
}
No description provided.