1 Star 0 Fork 0

QianXun-Studio / Grid.Blazor

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
Button_components.md 2.08 KB
一键复制 编辑 原始数据 按行查看 历史
Gustavo Navarro 提交于 2020-05-16 18:47 . Update documentation

GridBlazor for ASP.NET Core MVC

Button components on the grid

Index

Compoments can be embedded on a grid. These components can be started pushing a button on the top of the grid and will be shown on the screen.

Page definition

You can use the AddButtonComponent method of the GridClient object to add a component:

    var client = new GridClient<Order>(q => orderService.GetOrdersGridRows(columns, q), query, false, "ordersGrid", Columns, locale)
        .AddButtonComponent<EmployeeComponent>("Employees", "Employee's Grid");

AddButtonComponent method has 3 optional parameters:

Parameter Type Description
Actions IList<Action> (optional) the parent component can pass a list of Actions to be used by the component
Functions IList<Func<object,Task>> (optional) the parent component can pass a list of Functions to be used by the child component
Object object (optional) the parent component can pass an object to be used by the component

If you use any of these paramenters, you must use them when creating the component.

Component definition

You must also create a Blazor component that allows 4 optional parameters:

Parameter Type Description
Grid CGrid (optional) Grid can be used to get any required information
Actions IList<Action> (optional) the parent component can pass a list of Actions to be used by the component
Functions IList<Func<object,Task>> (optional) the parent component can pass a list of Functions to be used by the child component
Object object (optional) the parent component can pass an object to be used by the component

Actions, Functions and Object must be used when calling the AddButtonComponent method, but Grid can be used without this requirement.

The component can include any html elements as well as any event handling features.

This is an example of a grid with 2 additional components:

<- Events | Export to Excel ->

1
https://gitee.com/fan0217/Grid.Blazor.git
git@gitee.com:fan0217/Grid.Blazor.git
fan0217
Grid.Blazor
Grid.Blazor
master

搜索帮助