From 3a77152e5dd26623cf738285028e5cdd09fb5d04 Mon Sep 17 00:00:00 2001 From: Ilkay Ilknur Date: Thu, 10 Dec 2020 16:42:49 +0300 Subject: [PATCH] abp datagrid implementation. --- .../Components/AbpDataGrid.razor | 58 +++++++++++++++++++ .../Components/AbpDataGrid.razor.cs | 31 ++++++++++ 2 files changed, 89 insertions(+) create mode 100644 framework/src/Volo.Abp.BlazoriseUI/Components/AbpDataGrid.razor create mode 100644 framework/src/Volo.Abp.BlazoriseUI/Components/AbpDataGrid.razor.cs diff --git a/framework/src/Volo.Abp.BlazoriseUI/Components/AbpDataGrid.razor b/framework/src/Volo.Abp.BlazoriseUI/Components/AbpDataGrid.razor new file mode 100644 index 0000000000..8b6fabe294 --- /dev/null +++ b/framework/src/Volo.Abp.BlazoriseUI/Components/AbpDataGrid.razor @@ -0,0 +1,58 @@ +@typeparam TItem +@using Blazorise.DataGrid; + + + + + @foreach (var column in Columns) + { + if (column.Actions.Any()) + { + + + + @foreach (var action in column.Actions) + { + if (action.ConfirmationMessage != null) + { + + } + else + { + + } + } + + + + } + else + { + @if (column.Render != null) + { + + + @column.Render.Invoke(context) + + + } + else + { + + } + } + } + + \ No newline at end of file diff --git a/framework/src/Volo.Abp.BlazoriseUI/Components/AbpDataGrid.razor.cs b/framework/src/Volo.Abp.BlazoriseUI/Components/AbpDataGrid.razor.cs new file mode 100644 index 0000000000..14e517c0ba --- /dev/null +++ b/framework/src/Volo.Abp.BlazoriseUI/Components/AbpDataGrid.razor.cs @@ -0,0 +1,31 @@ +using Blazorise.DataGrid; +using Microsoft.AspNetCore.Components; +using System.Collections.Generic; +using Volo.Abp.AspNetCore.Components.Extensibility.TableColumns; + +namespace Volo.Abp.BlazoriseUI.Components +{ + public partial class AbpDataGrid : ComponentBase + { + protected Dictionary> ActionColumns = new Dictionary>(); + + [Parameter] + public IEnumerable Data { get; set; } + + [Parameter] + public EventCallback> ReadData { get; set; } + + [Parameter] + public int? TotalItems { get; set; } + + [Parameter] + public bool ShowPager { get; set; } + + [Parameter] + public int PageSize { get; set; } + + [Parameter] + public List Columns { get; set; } + + } +}