-
Notifications
You must be signed in to change notification settings - Fork 461
[DataGrid] Rewriting event propagation #2278
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
vnbaaij
left a comment
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 can understand the changes on the FluentDataGrid... component although I don't necessarily feel it makes the code clearer.
You are moving handling of row/cell specific events to a different location then from where it is actually being invoked (I mean handle cell click in datagrid instead of in datagridcell). No better separation of concerns, right?
What I don't like is having row based events in the realm of a column. In fact, I think that makes the code more unclear than it is.
Feels to me a bit like a refactoring because of refactoring but not providing any real added value or benefit. Am I missing something?
I'm essentially of the same opinion. Moreover, why make these |
|
If I created a new column, I could use the events without asking for any changes to the library. Ok instead of Func use EventCallback |
There are a lot of things that need to be taken into account for creating a new column. I don't see this as something we will be doing a lot.
Yes, it s integrated but that is not a bad thing. There are a lot of cogs that need to work together. You not being able to create your own columns is not a bad thing, I think.
But that does not address the fact that we have row functionality in the columns. For me that is a no-go. |
|
How it worked for SelectColumn could work for others. |
We are not stiving for making the DataGrid expandable like that
But again, when the column components contain row functionality it is a no-go |
|
You are right that columns should not have row events but for SelectColumn it happened. In this implementation I did not have to create a collection of SelectColumn and check if the event was for the right column, everything is encapsulated in the code of the SelectColumn class. SelectColumn could be one of those columns that has special implementation on rowclick. example if(MyGrid.AllowSelectRowByClick && !(column is _selectColumn))
{
.....
} |
|
Can you make it work with EventCallback and overloadable instead of public? Then we can maybe just do something with the naming to make it less rubbing me the wrong way |
|
What is this code in FluentDataGridRow /// <summary />
Task IHandleEvent.HandleEventAsync(EventCallbackWorkItem callback, object? arg)
=> callback.InvokeAsync(arg); |
…ui-blazor into datagrid-events
|
The idea seems good to me, but the way it's proposed seems too complex. Mainly for debugging. Give use some days to analyze your proposal to "extract" events to the `ColumnBase' class, for example using inheritance or other solution to simplify the usages. PS: I will probably create another separate PR to have a new discussion thread. |
|
Closing this now that we have #2298 |
To simplify event propagation and for new columns I added events to ColumnBase. FluentDataGridCell and FluentDataGridRow call FluentDataGrid. FluentDataGrid calls events in columns.
It seems like a clean solution and the logic for each column stays inside it. In FluentDataGrid you don't need to add anything.
I'm not sure what the HandleEventAsync event does in FluentDataGridRow