forked from gustavnavar/Grid.Blazor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathISGrid.cs
79 lines (61 loc) · 2.21 KB
/
ISGrid.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
using GridCore.Pagination;
using GridShared;
using GridShared.Sorting;
using GridShared.Totals;
using GridShared.Utility;
using Microsoft.Extensions.Primitives;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace GridCore
{
public interface ISGrid<T> : ISGrid, IGrid<T>
{
new IGridColumnCollection<T> Columns { get; }
IGridItemsProcessor<T> PagerProcessor { get; }
IGridItemsProcessor<T> SearchProcessor { get; }
IGridItemsProcessor<T> FilterProcessor { get; }
IGridItemsProcessor<T> SortProcessor { get; }
IGridItemsProcessor<T> TotalsProcessor { get; }
void SetRowCssClassesContraint(Func<T, string> contraint);
IEnumerable<T> GetItemsToDisplay();
Task<IEnumerable<T>> GetItemsToDisplayAsync(Func<IQueryable<T>, Task<IList<T>>> toListAsync);
void SetToListAsyncFunc(Func<IQueryable<T>, Task<IList<T>>> toListAsync);
}
public interface ISGrid : IGrid, IGridOptions
{
/// <summary>
/// Query for the grid
/// </summary>
QueryDictionary<StringValues> Query { get; }
/// <summary>
/// Pager for the grid
/// </summary>
IGridPager Pager { get; set; }
/// <summary>
/// Keys for subgrid
/// </summary>
string[] SubGridKeys { get; set; }
/// <summary>
/// Get foreign key values for subgrid records
/// </summary>
string[] GetSubGridKeyValues(object item);
IGridSettingsProvider Settings { get; }
GridRenderOptions RenderOptions { get; }
TotalsDTO GetTotals();
bool DefaultSortEnabled { get; set; }
GridSortMode GridSortMode { get; set; }
bool DefaultFilteringEnabled { get; set; }
void AutoGenerateColumns();
Task<IEnumerable<object>> GetItemsToDisplayAsync();
/// <summary>
/// Displaying grid items count
/// </summary>
Task<int> GetDisplayingItemsCountAsync();
/// <summary>
/// Get column values to display
/// </summary>
IList<object> GetValuesToDisplay(string columnName, IEnumerable<object> items);
}
}