forked from ebekker/blazor-ag-grid
/
GridEvents.cs
124 lines (109 loc) · 4.19 KB
/
GridEvents.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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
using System;
using System.Text.Json;
namespace AgGrid.Blazor
{
/// <summary>
/// Strongly-typed counterpart of:
/// https://www.ag-grid.com/javascript-grid-events/
/// </summary>
public partial class GridEvents
{
/// <summary>
/// Cell is clicked.
/// </summary>
public Action<CellClickedEvent> CellClicked { set => Set(value); }
/// <summary>
/// Row selection is changed. Use the grid API to get the new row selected.
/// </summary>
public Action<RowNode[]> SelectionChanged { set => Set(value); }
/// <summary>
/// Value has changed after editing.
/// </summary>
public Action<CellValueChangedEvent> CellValueChanged { set => Set(value); }
/// <summary>
/// A cell's value within a row has changed. This event corresponds to Full Row Editing only.
/// </summary>
public Action<RowValueChangedEvent> RowValueChanged { set => Set(value); }
/// <summary>
/// Editing a cell has started.
/// </summary>
public Action<CellEvent> CellEditingStarted { set => Set(value); }
/// <summary>
/// Editing a cell has stopped.
/// </summary>
public Action<CellEditingStoppedEvent> CellEditingStopped { set => Set(value); }
/// <summary>
/// Editing a row has started (when row editing is enabled). When row editing, this event will be fired once
/// and cellEditingStarted will be fired for each individual cell. This event corresponds to Full Row Editing only.
/// </summary>
public Action<RowEvent> RowEditingStarted { set => Set(value); }
/// <summary>
/// Editing a row has stopped (when row editing is enabled). When row editing, this event will be fired once
/// and cellEditingStopped will be fired for each individual cell. This event corresponds to Full Row Editing only.
/// </summary>
public Action<RowEvent> RowEditingStopped { set => Set(value); }
/// <summary>
/// Fired the first time data is rendered into the grid.
/// </summary>
public Action FirstDataRendered { set => Set(value); }
/// <summary>
/// The grid has initialised. The name 'ready' was influenced by the author's time programming the Commodore 64.
/// Use this event if, for example, you need to use the grid's API to fix the columns to size.
/// </summary>
public Action GridReady { set => Set(value); }
}
/// <summary>
/// Value has changed after editing.
/// </summary>
public class CellValueChangedEvent : CellEvent
{
public dynamic OldValue { get; set; }
public dynamic NewValue { get; set; }
}
/// <summary>
/// Value has changed after editing.
/// </summary>
public class CellEditingStoppedEvent : CellEvent
{
public dynamic OldValue { get; set; }
public dynamic NewValue { get; set; }
}
/// <summary>
///
/// </summary>
public class CellClickedEvent : CellEvent { }
/// <summary>
/// A cell's value within a row has changed. This event corresponds to Full Row Editing only.
/// </summary>
public class RowValueChangedEvent : RowEvent { }
public class RowEvent
{
public JsonElement Data { get; set; }
public string RowNodeId { get; set; }
public int RowIndex { get; set; }
public string RowPinned { get; set; }
public dynamic Context { get; set; }
public dynamic Event { get; set; }
}
public class CellEvent : RowEvent
{
///// <summary>
///// the column for the cell in question
///// </summary>
//public dynamic Column { get; set; }
///// <summary>
///// the column definition for the cell in question
///// </summary>
//public dynamic ColDef { get; set;}
public string Field { get; set; }
public string ColumnId { get; set; }
/// <summary>
/// the value for the cell in question
/// </summary>
public dynamic Value { get; set; }
}
public class FirstDataRenderedEvent
{
public string Type { get; set; }
}
}