You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -40,12 +41,286 @@ The `GanttCommandButton` tag offers the following features:
40
41
41
42
### Built-in Commands
42
43
43
-
There are four built-in commands:
44
+
There are two built-in commands:
44
45
45
46
*`Add` - initiates the creation of a new item. Can apply to rows as well, to create a child element for the current row.
46
-
*`Edit` - initiates the editing in the Gantt Tree.
47
-
*`Save` - performs the actual update operation after the data has been changed. Triggers the `OnUpdate` or `OnCreate` event so you can perform the data source operation. Which event is triggered depends on whether the item was created or edited.
48
-
*`Cancel` - aborts the current operation (edit or insert).
47
+
*`Delete` - initiates the deletion of an existing item.
48
+
49
+
### OnClick handler
50
+
51
+
The `OnClick` handler of the commands receives an argument of type `GanttTaskCommandEventArgs` that exposes the following properties:
52
+
53
+
*`IsCancelled` - set this to `true` to prevent the operation if the business logic requires it.
54
+
*`Item` - the model item of the Gantt row. You can use it to access the model fields and perform the actual data source operations. This property is applicable only for command buttons that are inside a Gantt row, not the toolbar.
55
+
*`IsNew` - a boolean field indicating whether the item was just added through the Gantt interface.
56
+
57
+
>tip For handling CRUD operations we recommend that you use the Gantt events (`OnEdit`, `OnUpdate`, `OnCancel`, `OnCreate`). The `OnClick` handler is available for the built-in commands to provide consistency of the API.
58
+
59
+
### Context
60
+
61
+
The command column provides access to the data item via `context`. This may be useful for conditional statements or passing parameters to custom business logic.
62
+
63
+
Use a **named** context variable to avoid errors when nesting components or `RenderFragment`s in general. In such cases, the exception will be similar to ["Child content element ... uses the same parameter name ('context') as enclosing child content element ..."]({%slug nest-renderfragment%}).
The following code example demonstrates declarations and handling of the built-in and custom commands.
85
+
86
+
>tip The event handlers use `EventCallback` and can be synchronous or async. This example shows async versions, and the signature for the synchronous handlers is `void MyHandlerName(GanttTaskCommandEventArgs args)`.
87
+
88
+
>caption Example of handling built-in and custom commands in the Gantt component
Copy file name to clipboardExpand all lines: components/grid/columns/command.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -52,7 +52,7 @@ There are four built-in commands:
52
52
The `OnClick` handler of the commands receives an argument of type `GridCommandEventArgs` that exposes the following properties:
53
53
54
54
*`IsCancelled` - set this to true to prevent the operation if the business logic requires it.
55
-
*`Item` - the model item the grid row is bound to. You can use it to access the model fields and methods in order to preform the actual data source operations. Applicable for buttons in a row, not in a toolbar.
55
+
*`Item` - the model item of the Grid row. You can use it to access the model fields and preform the actual data source operations. This property is applicable only for command buttons that are inside a Grid row, not the toolbar.
56
56
*`IsNew` - a boolean field indicating whether the item was just added through the grid interface.
57
57
58
58
>tip For handling CRUD operations we recommend that you use the grid events (`OnEdit`, `OnUpdate`, `OnCancel`, `OnCreate`). The `OnClick` handler is available for the built-in commands to provide consistency of the API.
Copy file name to clipboardExpand all lines: components/treelist/columns/command.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -75,7 +75,7 @@ The command column provides access to the data item via `context`. This may be u
75
75
The `OnClick` handler of the commands receives an argument of type `TreeListCommandEventArgs` that exposes the following properties:
76
76
77
77
*`IsCancelled` - set this to true to prevent the operation if the business logic requires it.
78
-
*`Item` - the model item the treelist row is bound to. You can use it to access the model fields and methods in order to preform the actual data source operations. Applicable for buttons in a row, not in a toolbar.
78
+
*`Item` - the model item of the treelist row. You can use it to access the model fields and preform the actual data source operations. This property is applicable only for command buttons that are inside a treelist row, not the toolbar.
79
79
*`ParentItem` - the parent item of the current item, if any, otherwise `null`.
80
80
*`IsNew` - a boolean field indicating whether the item was just added through the treelist interface.
0 commit comments