1 Star 0 Fork 0

XFly-Studio / Grid.Blazor

Create your Gitee Account
Explore and code with more than 6 million developers,Free private repositories !:)
Sign up
Clone or download
Button_components.md 2.08 KB
Copy Edit Web IDE Raw Blame History
Gustavo Navarro authored 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 ->

Comment ( 0 )

Sign in for post a comment

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

Search