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

DataGrid: Mixes CurrentPage and PageChanged into single two-way bindable param #5896

Merged
merged 8 commits into from
Dec 19, 2024

Conversation

tesar-tech
Copy link
Collaborator

Description

  • Mixes CurrentPage and PageChanged into single two-way bindable param
  • Fixes pagesize "bug" in datagrid test page;
  • Removes unnecessary DataGridPageChangedEventArgs.cs
  • updates release notes

Closes #3610

…able Page parameter; Fixes pagesize "bug" in datagrid test page; Removes unnecessary DataGridPageChangedEventArgs.cs
@tesar-tech tesar-tech requested a review from stsrki December 13, 2024 10:09
Copy link
Collaborator

@stsrki stsrki left a comment

Choose a reason for hiding this comment

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

What about renaming the CurrentPage in

  • PaginationContext
  • CurrentPage

Does that also makes sense?

@tesar-tech
Copy link
Collaborator Author

What about renaming the CurrentPage in

  • PaginationContext
  • CurrentPage

Does that also makes sense?

In PaginationContext and DataGridState there the current page is really a state, information. But in Datagrid it's more like a thing you can operate with (through binding). You "go to page 20" not "go to current page 20". In pagination it's more like "changing the current page".... Just slight nuance, no strong opinion.

Also renaming to Page in PaginationContext would require to rename all the event handlers, etc.

@stsrki
Copy link
Collaborator

stsrki commented Dec 17, 2024

What about renaming the CurrentPage in

  • PaginationContext
  • CurrentPage

Does that also makes sense?

In PaginationContext and DataGridState there the current page is really a state, information. But in Datagrid it's more like a thing you can operate with (through binding). You "go to page 20" not "go to current page 20". In pagination it's more like "changing the current page".... Just slight nuance, no strong opinion.

Also renaming to Page in PaginationContext would require to rename all the event handlers, etc.

From a user perspective, I think it makes sense to name them all the same. That way, we will be consistent.

@David-Moreira, what do you think?

@David-Moreira
Copy link
Contributor

I prefer the same naming always to avoid miss interpretations from different developers.

I also have no strong feelings about CurrentPage vs Page, I guess both are understandable, but generally you don't name parameters with "Current" prefix, like CurrentData, CurrentPageSize, CurrentFilter, etc, etc.. You just assume they are what it's set to or will be due to being set declaratively. Current is redundant in my opinion.

I'd not use current even to represent "current state". I believe that's already implied when accessing an api that represents state.

I think it only makes sense if you have two conflicts parameters to make it explicitly which one is which, i.e oldItem vs currentItem. And I'd probably still personally use OldItem and Item instead of the currentItem example.

@stsrki stsrki merged commit e248d69 into next-2.0 Dec 19, 2024
2 checks passed
@stsrki stsrki deleted the dev/next-2.0/datagrid-bindable-page branch December 19, 2024 11:00
@github-actions github-actions bot locked and limited conversation to collaborators Dec 19, 2024
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.

3 participants