DISCLAIMER: This code is almost 1 year old and it is not maintained.
A simple Server-Side Blazor CRUD app to deal with hierarchical data.
Project has a data layer with GraphQL for R (Retrieve) and classical Rest for CUD (Create Update Delete)
The basic functionality is ready:
- Unexpand nodes and expand nodes with Lazy load.
- Select and unselect a node.
- Insert new nodes
- ToDo: Update, Delete
Backend by @utrescu Frontend by @ctrl-alt-d.
<UITreeComponent SourceData=@uiTree
SelectChangeDelegate=@OnSelectionChanged
LazyLoadNodesAsyncDelegate=@LoadNodes
CollapseAsyncDelegate=@OnCollapse
ExpandAsyncDelegate=@OnExpand
TriggerActionAsyncDelegate=@OnAction>
</UITreeComponent>
@functions {
UITree uiTree = new UITree();
private async Task<bool> OnExpand(int Id)
{
System.Console.WriteLine("Expanded " + Id);
return await Task.FromResult(true);
}
- Launch GraphQL server:
( cd TreeCrud.Server/; dotnet run )
- Launch Blazor Server:
( cd TreeCrud.GraphQL/; ASPNETCORE_URLS="http://127.0.0.1:6000" dotnet run )
Use it as your risk. Steps:
- Download the project.
- Add a reference to it from your own project.
- Add the following line in your
_ViewImports.cshtml
:@addTagHelper *, BlazorTreeControl
- Please, PR your improvements and Issue for comments.
Don't hesitate to contact me for further information :)