Skip to content

Commit

Permalink
Docs update
Browse files Browse the repository at this point in the history
  • Loading branch information
gvreddy04 committed Aug 7, 2023
1 parent 2a035b2 commit 471d0e2
Show file tree
Hide file tree
Showing 4 changed files with 100 additions and 14 deletions.
4 changes: 2 additions & 2 deletions blazorbootstrap/Components/Grid/Grid.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@ public partial class Grid<TItem> : BaseComponent

#region Methods

protected override async Task OnInitializedAsync()
protected override void OnInitialized()
{
headerCheckboxId = IdGenerator.Generate;

pageSize = PageSize;

await base.OnInitializedAsync();
base.OnInitialized();
}

protected override Task OnParametersSetAsync()
Expand Down
57 changes: 57 additions & 0 deletions docs/blog/2023-08-12-blazorbootstrap-1.10.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
---
title: Blazor Bootstrap v1.10.0
authors:
name: Vikram Reddy
title: Creator
url: https://github.com/gvreddy04
image_url: https://avatars.githubusercontent.com/u/2337067
tags: [v1.10.0, blazor, bootstrap, bootstrap5, blazorbootstrap, grid, blazorgrid]
---

We are excited to release 1.10.0 with new Table and Card component. Charts, Grid, Button, Tooltip, and Switch component updates!!!

![image](https://i.imgur.com/qH7G1ZT.png "Blazor Bootstrap: Grid Component")

<!--truncate-->

## What's New

- `Table` Component
- TODO: Update

- `Card` Component
- TODO: Update

## What's changed

- `Bar Chart` component
- TODO: Update

- `Doughnut Chart` component
- TODO: Update

- `Line Chart` component
- TODO: Update

- `Pie Chart` component
- TODO: Update

- `Grid` component
- Grid: Filters translation support [#292](https://github.com/vikramlearning/blazorbootstrap/issues/292)

- `Button` component
- Tooltip color support added

- `Tooltip` component
- Tooltip color support added
- Tooltip on button problem [#296](https://github.com/vikramlearning/blazorbootstrap/issues/296)

- `Switch` component
- Switch is invoking EditContext OnFieldChanged even the change was not from UI [#297](https://github.com/vikramlearning/blazorbootstrap/issues/297)

## Links
- [Demo Website - Blazor Server](https://demos.blazorbootstrap.com/)
- [Demo Website - Blazor WebAssembly](https://demos.getblazorbootstrap.com/)
- [Blazor Line Chart Component Documentation](https://getblazorbootstrap.com/docs/components/charts)
- [Blazor Grid Component Documentation](https://getblazorbootstrap.com/docs/components/grid)
- [Blazor Switch Component Documentation](https://getblazorbootstrap.com/docs/forms/switch)
51 changes: 40 additions & 11 deletions docs/docs/05-components/grid.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Use Blazor Bootstrap grid component to display tabular data from the data source
| EmptyDataTemplate | RenderFragment | | ✔️ | Template to render when there are no rows to display. | 1.0.0 |
| EmptyText | string | No records to display | | Shows text on no records. | 1.0.0 |
| FiltersRowCssClass | string | | | Gets or sets the filters row css class. | 1.9.2 |
| FiltersTranslationProvider | `GridFiltersTranslationDelegate` | | | Filters transalation is for grid filters to render. The provider should always return a 'FilterOperatorInfo' collection, and 'null' is not allowed. | 1.10.0 |
| HeaderRowCssClass | string | | | Gets or sets the header row css class but not the thead tag class. | 1.9.2 |
| ItemsPerPageText | string | `Items per page` | ✔️ | Gets or sets the ItemsPerPageText. | 1.9.5 |
| PageSize | int | 10 | | Gets or sets the page size of the grid. | 1.0.0 |
Expand Down Expand Up @@ -2536,45 +2537,73 @@ Also, disable check the row level checkbox if the employee Id is less than 105.

### Translations

In the example below, you will see translations related to pagination in **Dutch**.
In the example below, you will see translations related to pagination and filters in **Dutch**.

<img src="https://i.imgur.com/qH7G1ZT.png" alt="Blazor Bootstrap: Grid Component - Translations" />
<img src="https://i.imgur.com/kKNgo2I.png" alt="Blazor Bootstrap: Grid Component - Translations" />

```cshtml {8,9} showLineNumbers
```cshtml {8,13-14} showLineNumbers
<Grid TItem="Employee1"
Class="table table-hover table-bordered table-striped"
DataProvider="EmployeesDataProvider"
AllowFiltering="true"
AllowPaging="true"
AllowSorting="true"
Class="table table-hover"
DataProvider="EmployeesDataProvider"
FiltersRowCssClass="bg-dark text-white bg-opacity-25 border-bottom-0"
FiltersTranslationProvider="GridFiltersTranslationProvider"
HeaderRowCssClass="bg-dark text-white border-bottom-0"
PageSize="10"
PageSizeSelectorVisible="true"
PageSizeSelectorItems="@(new int[] { 5,10,20 })"
PaginationItemsTextFormat="{0} - {1} van {2} artikelen"
ItemsPerPageText="Artikelen per pagina"
Responsive="true">
<GridColumn TItem="Employee1" HeaderText="Id">
<GridColumn TItem="Employee1" HeaderText="Id" PropertyName="Id" SortKeySelector="item => item.Id">
@context.Id
</GridColumn>
<GridColumn TItem="Employee1" HeaderText="Employee Name">
<GridColumn TItem="Employee1" HeaderText="Employee Name" PropertyName="Name" SortKeySelector="item => item.Name">
@context.Name
</GridColumn>
<GridColumn TItem="Employee1" HeaderText="Designation">
<GridColumn TItem="Employee1" HeaderText="Designation" PropertyName="Designation" SortKeySelector="item => item.Designation">
@context.Designation
</GridColumn>
<GridColumn TItem="Employee1" HeaderText="DOJ">
<GridColumn TItem="Employee1" HeaderText="DOJ" PropertyName="DOJ" SortKeySelector="item => item.DOJ">
@context.DOJ
</GridColumn>
<GridColumn TItem="Employee1" HeaderText="Active">
<GridColumn TItem="Employee1" HeaderText="Active" PropertyName="IsActive" SortKeySelector="item => item.IsActive">
@context.IsActive
</GridColumn>
</Grid>
```

```cs {} showLineNumbers
```cs {4-25} showLineNumbers
@code {
private IEnumerable<Employee1> employees = default!;

private async Task<IEnumerable<FilterOperatorInfo>> GridFiltersTranslationProvider()
{
var filtersTranslation = new List<FilterOperatorInfo>();

// number/date/boolean
filtersTranslation.Add(new("=", "gelijk aan", FilterOperator.Equals));
filtersTranslation.Add(new("!=", "Niet gelijk", FilterOperator.NotEquals));
// number/date
filtersTranslation.Add(new("<", "Minder dan", FilterOperator.LessThan));
filtersTranslation.Add(new("<=", "Kleiner dan of gelijk aan", FilterOperator.LessThanOrEquals));
filtersTranslation.Add(new(">", "Groter dan", FilterOperator.GreaterThan));
filtersTranslation.Add(new(">=", "Groter dan of gelijk aan", FilterOperator.GreaterThanOrEquals));
// string
filtersTranslation.Add(new("*a*", "Bevat", FilterOperator.Contains));
filtersTranslation.Add(new("a**", "Begint met", FilterOperator.StartsWith));
filtersTranslation.Add(new("**a", "Eindigt met", FilterOperator.EndsWith));
filtersTranslation.Add(new("=", "gelijk aan", FilterOperator.Equals));
// common
filtersTranslation.Add(new("x", "Duidelijk", FilterOperator.Clear));

return await Task.FromResult(filtersTranslation);
}

private async Task<GridDataProviderResult<Employee1>> EmployeesDataProvider(GridDataProviderRequest<Employee1> request)
{
if (employees is null) // pull employees only one time for client-side filtering, sorting, and paging
Expand Down
2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "blazorbootstrap",
"version": "1.9.5",
"version": "1.10.0",
"private": true,
"scripts": {
"docusaurus": "docusaurus",
Expand Down

0 comments on commit 471d0e2

Please sign in to comment.