Skip to content
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

support ordering grid groups using comparer function #1219

Merged
merged 3 commits into from
May 17, 2024

Conversation

nebojsa-peric
Copy link
Collaborator

No description provided.

@@ -73,6 +73,7 @@ interface GridGroupingConfig {
caption?: StringProp;
name?: StringProp;
text?: StringProp;
comparer?: (a: any, b: any) => number;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typing for the comparer arguments could be improved. Instead of any we should introduce a type.

interface GroupingResult {
  key: any,
  aggregates: any,
  name: string,
  results: any[]
}

and whatever else is inside that object.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The results field could also be typed similar to this:

interface GridProps<T = unknown>

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, will make the change. It was a copy/paste from column comparer definition. 🙂

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

* use MappedGridRecord type in DataAdapter
* add GroupingResult<T> type for grouping config comparer
* make grid grouping types generic
* modify FetchRecordsResult types
* make MappedGridRecord extend DataAdapterRecord
@mstijak mstijak merged commit 71a0d60 into master May 17, 2024
@mstijak mstijak deleted the feat/master/add-grid-groups-sorting-function branch May 17, 2024 12:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants