-
Notifications
You must be signed in to change notification settings - Fork 161
feat(IgxGridBaseDirective): Add Single and Multiple sorting options #10336
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
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.
Good job.
Address the comments and fix the lint errors.
…niteUI/igniteui-angular into kdragieva/grid-sorting-master
@@ -4450,6 +4478,12 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements | |||
} else { | |||
if (expression.dir === SortingDirection.None) { | |||
this.gridAPI.remove_grouping_expression(expression.fieldName); | |||
} else if (this._sortingOptions.mode === 'single') { |
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.
My idea was to move this logic over here:
igniteui-angular/projects/igniteui-angular/src/lib/grids/api.service.ts
Lines 213 to 219 in 264f130
public sort(expression: ISortingExpression): void { | |
if (expression.dir === SortingDirection.None) { | |
this.remove_grouping_expression(expression.fieldName); | |
} | |
const sortingState = cloneArray(this.grid.sortingExpressions); | |
this.prepare_sorting_expression([sortingState], expression); | |
this.grid.sortingExpressions = sortingState; |
However now that I look at it, I don't think we have cleared the interaction between single mode sorting
and the group by feature of the grid.
@hanastasov @ChronosSF Maybe we should start discussing this before moving forward with this PR
change ISortingOptions interface Co-authored-by: Radoslav Karaivanov <[email protected]>
Co-authored-by: Radoslav Karaivanov <[email protected]>
…niteUI/igniteui-angular into kdragieva/grid-sorting-master
There has been no recent activity and this PR has been marked inactive. |
…into kdragieva/grid-sorting-master
…into kdragieva/grid-sorting-master
…niteUI/igniteui-angular into ddincheva/groupingSorting-13.1.x
Separate grouping and sorting
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.
Generally the code looks OK to me and according to expectation set from the spec. I found the following bugs we need to address:
- Sort indication is not refreshed
- sort by multiple columns
- Set sorting mode to single
- result: column headers still have the sort css classes
clearSort
andsort
methods do not refresh the grid
- sort columns
- grid.clearSort() does not refresh the grid state
OR
- sort columns via API
- grid is not refreshed
- Sorting via API changes the grouping expressions
- group by column ContactTitle in ASC order
- sort programatically the ContactTitle column by DESC order:
grid.sort([{"dir": 2,
"fieldName": "ContactTitle",
"ignoreCase": true}]) - Result: grouping expressions has changed
If sorting the column by clicking the sorting indicator whitin the chip in group area - DOES NOT change sorting expressions, which is expected.
- TO DISCUSS LATER:
Story 6: As a developer, I want to be able to disregard the sorting MODE option, by working direcdtly with the API. Example: If sorting mode is single, I still want to be able to apply multiple sorting via API.
Doing that results in multiple columns sorted, but they lack the ordering number. To discuss - Shall we display numbering order now?
@@ -582,7 +579,7 @@ export class IgxGridComponent extends IgxGridBaseDirective implements GridType, | |||
* @hidden @internal | |||
*/ | |||
public isDetailRecord(record) { | |||
return record && record.detailsData !== undefined; |
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.
I remember putting this check on a purpose when record was coming as undefined
. I will double check if we need it.
…into kdragieva/grid-sorting-master
Closes #9674
Closes #11269
Closes #10765
Additional information (check all that apply):
Checklist:
feature/README.MD
updates for the feature docsREADME.MD
CHANGELOG.MD
updates for newly added functionalityng update
migrations for the breaking changes (migrations guidelines)