diff --git a/src/MatBlazor/Components/MatTable/MatTable.razor b/src/MatBlazor/Components/MatTable/MatTable.razor index 514f879a..f8a69b6e 100644 --- a/src/MatBlazor/Components/MatTable/MatTable.razor +++ b/src/MatBlazor/Components/MatTable/MatTable.razor @@ -2,6 +2,7 @@ @inherits BaseMatTable @typeparam TableItem @inject System.Net.Http.HttpClient Http +@inject NavigationManager NavMan @using System @using System.Collections.Generic @@ -159,6 +160,15 @@ StartPage = 1; CurrentPage = StartPage; + // If search term name has been specified, fetch the value (if available) and perform search and filtering right away + if (!string.IsNullOrWhiteSpace(SearchTermParamName)) + { + var uri = new Uri(NavMan.Uri); + SearchTerm = Microsoft.AspNetCore.WebUtilities.QueryHelpers.ParseQuery(uri.Query).TryGetValue(SearchTermParamName, out var type) ? type.First() : ""; + + if (!string.IsNullOrWhiteSpace(SearchTerm)) FilterData(); + } + if (!string.IsNullOrWhiteSpace(ApiUrl) && (RequestApiOnlyOnce || LoadInitialData)) { try diff --git a/src/MatBlazor/MatBlazor.csproj b/src/MatBlazor/MatBlazor.csproj index 0e3b6742..ac095209 100644 --- a/src/MatBlazor/MatBlazor.csproj +++ b/src/MatBlazor/MatBlazor.csproj @@ -36,6 +36,7 @@ +