Skip to content
This repository was archived by the owner on Jun 1, 2025. It is now read-only.

feat(sorting): add "Clear Sort" in each Column Header Menu #94

Merged
merged 2 commits into from
Jan 9, 2019

Conversation

ghiscoding
Copy link
Owner

No description provided.

if (grid && dataView) {
if (forceReSort) {
this._dataView.reSort();
Copy link
Owner Author

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';
Copy link
Owner Author

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

@@ -3,6 +3,7 @@
"CANCEL": "Cancel",
"CLEAR_ALL_FILTERS": "Clear All Filters",
"CLEAR_ALL_SORTING": "Clear All Sorting",
"CLEAR_SORT": "Clear Sort",
Copy link
Owner Author

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 + '');
Copy link
Owner Author

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
Copy link
Owner Author

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) {
}

@ghiscoding ghiscoding merged commit fe059ed into master Jan 9, 2019
@ghiscoding ghiscoding deleted the feat/header-menu-clear-sort-column branch February 9, 2019 21:01
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant