-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Resolves #242 partly, ability to reorder columns by drag and drop (#319)
* Resolves #242 partly, alows to reorder columns by drag and drop * Fixed glitching drag effects when mouse was hovering over grid title, added config option for choosing dbprovider * Created seperate column builder method for rearangable view * Cleanup, removed dead code * Added documentation page * Added method docs, and changed to do nothing on cur pos eq target pos * Added terun type that indicates succes or failure Co-authored-by: kus <kus@kus>
- Loading branch information
Showing
30 changed files
with
360 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
GridBlazorClientSide.Client/Pages/RearrangeableColumns.razor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
@page "/rearrangeable" | ||
@using GridBlazorClientSide.Client.ColumnCollections | ||
@using GridBlazorClientSide.Shared.Models | ||
@using Microsoft.Extensions.Primitives | ||
@using System.Globalization | ||
@using System.Threading.Tasks | ||
@inject NavigationManager NavigationManager | ||
@inject HttpClient HttpClient | ||
|
||
<h1>Rearrangeable Grid</h1> | ||
|
||
<p> | ||
This page contains a grid with grid clomuns rearrange. Column titles can be dragged and dropped on each other to change order. | ||
</p> | ||
|
||
<p> | ||
This component demonstrates a GridBlazor client-side grid. For more information, please see: <a href="https://github.com/gustavnavar/Grid.Blazor">https://github.com/gustavnavar/Grid.Blazor</a> | ||
</p> | ||
|
||
@if (_task.IsCompleted) | ||
{ | ||
<div class="row"> | ||
<div class="col-md-12"> | ||
<GridComponent T="Order" Grid="@_grid"></GridComponent> | ||
</div> | ||
</div> | ||
} | ||
else | ||
{ | ||
<p><em>Loading...</em></p> | ||
} | ||
|
||
@code | ||
{ | ||
private CGrid<Order> _grid; | ||
private Task _task; | ||
|
||
protected override async Task OnParametersSetAsync() | ||
{ | ||
var locale = CultureInfo.CurrentCulture; | ||
|
||
var query = new QueryDictionary<StringValues>(); | ||
string url = NavigationManager.BaseUri + "api/SampleData/GetOrdersGridRearrangeableColumns"; | ||
var client = new GridClient<Order>(HttpClient, url, query, false, "ordersGrid", | ||
ColumnCollections.OrderColumnsRearrangeable, locale) | ||
.Sortable() | ||
.Filterable() | ||
.SetStriped(true) | ||
.WithMultipleFilters() | ||
.WithGridItemsCount() | ||
.RearrangeableColumns(true); | ||
|
||
_grid = client.Grid; | ||
// Set new items to grid | ||
_task = client.UpdateGrid(); | ||
await _task; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.