DataGrid | Cell Navigation support | CellEdit Mode options #5506
+547
−19
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Ok so while improving the cell edit feature I realized the following:
Cell navigation can just be a standalone feature. By activating the feature, both single clicking, using arrow keys & tabbing will navigate through the cells.
I was initially doing it as part of the cell edit mode, but if it's a standalone feature, the user can just activate whenever he wants. We can recommend to activate it in the docs for cell edit mode.
Introduced a new
DataGridEditModeOptions
. Here we'll have two new options:CellEditOnSingleClick
,CellEditOnDoubleClick
that are self explanatory.Here I would take the breaking change where we default to double click. Users can still enable the old behaviour by setting the
CellEditOnSingleClick
to true.Just by adding the extra cell navigation and the single/double click the user has enough flexibility from what I've experienced.
All in all by just adding
CellNavigable
to a CellEdit enabled Grid the experience is much better!Let me know your thoughts.
Notes:
You will see that we require a new bit of javascript for this feature, I did try to make it work in C#, but as you know, when you have alot of dynamic elements and you have to try to figure out stuff in DOM it gets really hard and cumbersome. I think it's best to do it in js.