|
47 | 47 | } |
48 | 48 | @if (ShowDefaultButtons) |
49 | 49 | { |
50 | | - @if (ShowAddButton) |
| 50 | + @if (ShowAddButton && ScrollMode == ScrollMode.None) |
51 | 51 | { |
52 | 52 | <TableToolbarButton TItem="TItem" Color="Color.Success" OnClick="AddAsync" Icon="@AddButtonIcon" Text="@AddButtonText" IsDisabled="GetAddButtonStatus()" /> |
53 | 53 | } |
54 | | - @if (!IsExcel && ShowEditButton) |
| 54 | + @if (!IsExcel && ShowEditButton && ScrollMode == ScrollMode.None) |
55 | 55 | { |
56 | 56 | <TableToolbarButton TItem="TItem" IsDisabled="GetEditButtonStatus()" Color="Color.Primary" OnClick="EditAsync" Icon="@EditButtonIcon" Text="@EditButtonText" IsEnableWhenSelectedOneRow="true" /> |
57 | 57 | } |
|
366 | 366 | @RenderHeader(false) |
367 | 367 | } |
368 | 368 | <tbody> |
369 | | - @if (InsertRowMode == InsertRowMode.First) |
370 | | - { |
371 | | - if (!IsExcel && EditMode == EditMode.EditForm && ShowAddForm) |
372 | | - { |
373 | | - @RenderEditForm.Invoke((EditModel, ItemChangedType.Add)) |
374 | | - } |
375 | | - if (AddInCell) |
376 | | - { |
377 | | - @RenderRow(EditModel) |
378 | | - } |
379 | | - } |
380 | 369 | @if (ScrollMode == ScrollMode.Virtual) |
381 | 370 | { |
382 | 371 | @if (Items != null) |
|
394 | 383 | } |
395 | 384 | else |
396 | 385 | { |
397 | | - @foreach (var item in Rows) |
| 386 | + if (InsertRowMode == InsertRowMode.First) |
| 387 | + { |
| 388 | + if (!IsExcel && EditMode == EditMode.EditForm && ShowAddForm) |
| 389 | + { |
| 390 | + @RenderEditForm.Invoke((EditModel, ItemChangedType.Add)) |
| 391 | + } |
| 392 | + if (AddInCell) |
| 393 | + { |
| 394 | + @RenderRow(EditModel) |
| 395 | + } |
| 396 | + } |
| 397 | + foreach (var item in Rows) |
398 | 398 | { |
399 | 399 | OnBeforeRenderRow?.Invoke(item); |
400 | 400 | if (RowTemplate != null) |
|
439 | 439 | @RenderEditForm((EditModel, ItemChangedType.Update)) |
440 | 440 | } |
441 | 441 | } |
442 | | - @if (IsShowEmpty) |
| 442 | + if (InsertRowMode == InsertRowMode.Last) |
| 443 | + { |
| 444 | + if (!IsExcel && EditMode == EditMode.EditForm && ShowAddForm) |
| 445 | + { |
| 446 | + @RenderEditForm.Invoke((EditModel, ItemChangedType.Add)) |
| 447 | + } |
| 448 | + if (AddInCell) |
| 449 | + { |
| 450 | + @RenderRow(EditModel) |
| 451 | + } |
| 452 | + } |
| 453 | + if (IsShowEmpty) |
443 | 454 | { |
444 | 455 | <tr> |
445 | 456 | <td colspan="@GetEmptyColumnCount()"> |
|
449 | 460 | </tr> |
450 | 461 | } |
451 | 462 | } |
452 | | - @if (InsertRowMode == InsertRowMode.Last) |
453 | | - { |
454 | | - if (!IsExcel && EditMode == EditMode.EditForm && ShowAddForm) |
455 | | - { |
456 | | - @RenderEditForm.Invoke((EditModel, ItemChangedType.Add)) |
457 | | - } |
458 | | - if (AddInCell) |
459 | | - { |
460 | | - @RenderRow(EditModel) |
461 | | - } |
462 | | - } |
463 | 463 | </tbody> |
464 | 464 | @if (IsShowFooter) |
465 | 465 | { |
|
0 commit comments