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: Prefer DatePicker DataGridDateEditColumn and add public API #5719

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

David-Moreira
Copy link
Contributor

No description provided.

@stsrki stsrki changed the title Datagrid | DataGridDateEditColumn | Prefer DatePicker | Add public api DataGrid: Prefer DatePicker DataGridDateEditColumn and add public API Sep 6, 2024
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.

Looking good to me.

What do you think if we add API, like bool NativeMode, that will keep the DateEdit<> if enabled?

@stsrki stsrki added this to the 1.7 milestone Sep 23, 2024
@David-Moreira
Copy link
Contributor Author

Looking good to me.

What do you think if we add API, like bool NativeMode, that will keep the DateEdit<> if enabled?

Then I'd do the same thing for the numeric column. Would you agree? Also altough NativeMode is a clear name for us, it might not be for our users? Do they understand exactly what NativeMode means? Altough I'm not finding a better name.

@stsrki
Copy link
Collaborator

stsrki commented Sep 27, 2024

Then I'd do the same thing for the numeric column. Would you agree?

Since we are going with new options I think it makes sense to make it for numeric column also.

Also altough NativeMode is a clear name for us, it might not be for our users? Do they understand exactly what NativeMode means? Altough I'm not finding a better name.

Maybe NativeInputMode?

@David-Moreira
Copy link
Contributor Author

Then I'd do the same thing for the numeric column. Would you agree?

Since we are going with new options I think it makes sense to make it for numeric column also.

Also altough NativeMode is a clear name for us, it might not be for our users? Do they understand exactly what NativeMode means? Altough I'm not finding a better name.

Maybe NativeInputMode?

So I was starting to work on this, but I noticed that there really isn't feature parity. The native one might have different parameters, features...
Do you think it makes sense to have Parameters that will only have effect when in a certain Mode? That might be a little bit confusing and might mislead users to try and use incompatible combinations?
i.e
NativeInputMode=true+ DisabledDays
NativeInputMode=false + Step, etc...

image
image

@stsrki
Copy link
Collaborator

stsrki commented Sep 29, 2024

Then I'd do the same thing for the numeric column. Would you agree?

Since we are going with new options I think it makes sense to make it for numeric column also.

Also altough NativeMode is a clear name for us, it might not be for our users? Do they understand exactly what NativeMode means? Altough I'm not finding a better name.

Maybe NativeInputMode?

So I was starting to work on this, but I noticed that there really isn't feature parity. The native one might have different parameters, features... Do you think it makes sense to have Parameters that will only have effect when in a certain Mode? That might be a little bit confusing and might mislead users to try and use incompatible combinations? i.e NativeInputMode=true+ DisabledDays NativeInputMode=false + Step, etc...

image image

We just need to document it and say that in native mode those parameters will be ignored.

@David-Moreira
Copy link
Contributor Author

Then I'd do the same thing for the numeric column. Would you agree?

Since we are going with new options I think it makes sense to make it for numeric column also.

Also altough NativeMode is a clear name for us, it might not be for our users? Do they understand exactly what NativeMode means? Altough I'm not finding a better name.

Maybe NativeInputMode?

So I was starting to work on this, but I noticed that there really isn't feature parity. The native one might have different parameters, features... Do you think it makes sense to have Parameters that will only have effect when in a certain Mode? That might be a little bit confusing and might mislead users to try and use incompatible combinations? i.e NativeInputMode=true+ DisabledDays NativeInputMode=false + Step, etc...
image image

We just need to document it and say that in native mode those parameters will be ignored.

It's both modes. Both modes might have some parameter that's incompatible with the other.

@stsrki
Copy link
Collaborator

stsrki commented Sep 30, 2024

Yeah, that makes it more complicated.

If there are overlapping parameters in terms of features then prefer the higher ones. Introduce DisabledDays but don't introduce Step.

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.

It would be good to have an example in the docs that re-enables native mode.

/// <summary>
/// Gets the date format based on the current <see cref="InputMode"/> settings.
/// </summary>
[Parameter] public string DateDisplayFormat { get; set; }
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we reuse the DisplayFormat from BaseDataGridColumn? It is the same thing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Makes sense, although this would have the advantage that you could have a different display format (when viewing the table) and edit format (when editing the records)

Copy link
Collaborator

Choose a reason for hiding this comment

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

In the past this DisplayFormat was used on DateEdit. Back then, DateEdit was using some JS for formating. So it makes sense to make it used on DatePicker today.

{
@if ( Column.NativeInputMode )
{
@dateEditFragment
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just a small note. Make it uppercase so it matches the naming for numeric component, (NumericEditFragment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DataGrid | DataGridEditColumn | Prefer DatePicker | Add DateInputMode & public api
2 participants