mirror of
https://github.com/radzenhq/radzen-blazor.git
synced 2026-07-08 18:16:08 +00:00
Cell edit demos fixed to mark the cell as edited properly
This commit is contained in:
@@ -168,13 +168,12 @@ ColumnWidth="200px" CellClick="@OnCellClick">
|
||||
/// <param name="args"></param>
|
||||
async Task OnCellClick(DataGridCellMouseEventArgs<Order> args)
|
||||
{
|
||||
if (!grid.IsValid ||
|
||||
if (!grid.IsValid ||
|
||||
(ordersToUpdate.Contains(args.Data) && columnEditing == args.Column.Property)) return;
|
||||
|
||||
// Record the previous edited field, if you're not using IRevertibleChangeTracking to track object changes
|
||||
// Commit any pending edit before switching to the new cell.
|
||||
if (ordersToUpdate.Any())
|
||||
{
|
||||
editedFields.Add(new(ordersToUpdate.First().OrderID, columnEditing));
|
||||
await Update();
|
||||
}
|
||||
|
||||
@@ -205,6 +204,8 @@ ColumnWidth="200px" CellClick="@OnCellClick">
|
||||
|
||||
if (ordersToUpdate.Any())
|
||||
{
|
||||
// Record the edited field so the cell gets the "edited" indicator.
|
||||
editedFields.Add(new(ordersToUpdate.First().OrderID, columnEditing));
|
||||
await grid.UpdateRow(ordersToUpdate.First());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -141,7 +141,6 @@
|
||||
|
||||
if (tasksToUpdate.Any())
|
||||
{
|
||||
editedFields.Add(new(tasksToUpdate.First().Id, columnEditing));
|
||||
await Update();
|
||||
}
|
||||
|
||||
@@ -169,6 +168,7 @@
|
||||
|
||||
if (tasksToUpdate.Any())
|
||||
{
|
||||
editedFields.Add(new(tasksToUpdate.First().Id, columnEditing));
|
||||
await gantt.UpdateRow(tasksToUpdate.First());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user