Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100]
Unhandled exception rendering component: Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index')
System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index')
at System.Collections.Generic.List
1[[Microsoft.AspNetCore.Components.EventCallback1[[BlazorStrap.BSTabEvent, BlazorStrap, Version=1.5.1.0, Culture=neutral, PublicKeyToken=null]], Microsoft.AspNetCore.Components, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]].RemoveAt(Int32 index)
at BlazorStrap.BSTabGroup.OnAfterRenderAsync(Boolean firstrun)
at Microsoft.AspNetCore.Components.ComponentBase.Microsoft.AspNetCore.Components.IHandleAfterRender.OnAfterRenderAsync()
at Microsoft.AspNetCore.Components.Rendering.ComponentState.NotifyRenderCompletedAsync()
private void TabShown(BSTabEvent e)
{
if (e.Activated != null)
{
this.AppState.SelectedTab = e.Activated?.Name;
}
}
@JulianDev24_gitlab https://www.nuget.org/packages/BlazorStrap/5.0.105-Preview1 / https://blazorstrap.io/V5/content/tables data table has been added preview build because I had to make a few changes to other components
That looks great ...
I think the Method for the DataSet might be a little bit to complex for newer Developers.
It works with Reflections but its not the Best ways i think :D
The example is showing dynamic loading from a fake dataset. Standard loaded dataset would be far simpler to look at. And what that could look like with api is simply
return= await Http.GetFromJsonAsync<Employee[]>($"http://fake.com/getEmployees?orderby={sortColumn}&desc={desc}page={page}&filterColumn={filterColumn}&q={filter}");
but then u have unlimited api requests if u dont use a cache in front of it...
So a simpler Method is needed..
I will thinker over one if i have more time :D
I am looking forward to seeing what you come up with. I will expand/explain my thought process a little bit here. So there is a better understanding of the overall objective.
I provided a dumbed-down example of calling an API. You could easily cache calls in the method. Yes, some work is going to be required by the end programmer. Also, to be clear, it's not invoking the method each time it draws. API calls in the example would only happen on sort, filter, page change. The design goal is to empower them with total control over how the data comes in without assuming anything.
What I don't want is for the user to have to do is hook Sort, Page, Filter events. Then have to reference BSDataTable to call a refresh on each event.
<BSInputCheckbox CheckedValue="true" UnCheckedValue="false" ValueChanged="(bool e) => Callback(e)" Value="value" />
@code {
bool value { get; set; }
private void Callback(bool e)
{
value = e;
// your stuff
}
}
crit: Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100]
Unhandled exception rendering component: Object reference not set to an instance of an object.
System.NullReferenceException: Object reference not set to an instance of an object.
at SyxosWASM.Pages.Error.OccurredErrors.InfoCallBack(ErrorModel errorModel)
at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)
at BlazorStrap.BlazorStrapActionBase.ClickEvent(MouseEventArgs e)
at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)
at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState)
<div aria-live="polite" aria-atomic="true" class="position-relative bd-example-toasts" style="overflow-y: scroll ">
<BSToaster/>
</div>
@Body
_blazorStrap.Toaster.Add("Error", "Test Error", o =>
{
o.Color = BSColor.Danger;
o.CloseAfter = 3000;
o.Toast = Toast.TopRight;
});
I dont get why its not working 🤷🏼♂️