protected override void BuildRenderTree(RenderTreeBuilder builder) { base.BuildRenderTree(builder); var rendererTreeBuilder = new BlazorRendererTreeBuilder(builder); var gridContexts = RendererContextFactory.CreateContexts(tableDataSet); RenderFragment <ImutableGridRendererContext> grid = (ImutableGridRendererContext imutableGridRendererContext) => delegate(RenderTreeBuilder internalBuilder) { var gridRendererContext = new GridRendererContext(gridContexts.ImutableRendererContext, new BlazorRendererTreeBuilder(internalBuilder), tableDataSet); GridRendererTreeBuilder.BuildRendererTree(gridRendererContext, gridContexts.PermissionContext); }; rendererTreeBuilder .OpenComponent(typeof(GridViewTable)) .AddAttribute(nameof(ImutableGridRendererContext), gridContexts.ImutableRendererContext) .AddAttribute(RenderTreeBuilder.ChildContent, grid) .CloseComponent(); if (gridContexts.ImutableRendererContext.CreateItemIsAllowed()) { rendererTreeBuilder .OpenComponent(typeof(CreateItemModal)) .AddAttribute(nameof(CreateItemOptions), gridContexts.ImutableRendererContext.GridConfiguration.CreateItemOptions) .AddAttribute(nameof(PermissionContext), gridContexts.PermissionContext) .AddAttribute(nameof(CreateFormCssClasses), gridContexts.ImutableRendererContext.CssClasses.CreateFormCssClasses) .AddAttribute(nameof(NewItemCreated), NewItemCreated) .CloseComponent(); } }
protected override void BuildRenderTree(RenderTreeBuilder builder) { base.BuildRenderTree(builder); var gridContexts = RendererContextFactory.CreateContexts(tableDataSet, builder); GridRendererTreeBuilder.BuildRendererTree(gridContexts.RendererContext, gridContexts.PermissionContext); }