Replies: 3 comments
-
|
My final solution on Blazor Server Side with Mudblazor 8.7 was using
I did it that way because there were problems with using both @bind-CurrentPage and @bind-RowsPerPage simultaneously since both of these call StateHasChanged() when the value changes, so when I was setting both of them, I was often getting a cancellation error. In that basic example it may not be necessary, but when I was having a very long asynchronous loading data, to prevent any races when the table renders, before I loaded data, I was using a flag to render the table only after I loaded that data. Previous example done that way: |
Beta Was this translation helpful? Give feedback.
-
|
A similar concept can be set by setting the ServerData="ServerReload" to a null Function variable. Then when you are ready for data set the function and call grid.ReloadServerData() (or something similar). That way your grid can do all it's drawing and logic before you actually load the data. |
Beta Was this translation helpful? Give feedback.
-
|
For others landing here, also take a look at #10702. Using public Task ReloadServerData(int? page = null)
{
if (page is not null)
_currentPage = page;
return InvokeServerLoadFunc();
} |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I would like to set page, page size and sort concrete column in chosen order from code, before loading my data from backend. How to do this properly?
Should I assign values to table.RowsPerPage and table.CurrentPage in OnInitializedAsync
or maybe use bind?
or use SetRowsPerPage and NavigateTo?
or maybe there's a better way to do it?
Beta Was this translation helpful? Give feedback.
All reactions