Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/MatBlazor/Components/MatTable/MatTable.razor
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
@inherits BaseMatTable
@typeparam TableItem
@inject System.Net.Http.HttpClient Http
@inject NavigationManager NavMan

@using System
@using System.Collections.Generic
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/MatBlazor/MatBlazor.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components" Version="3.1.10" />
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="3.1.10" />
<PackageReference Include="Microsoft.AspNetCore.WebUtilities" Version="2.2.0" />
</ItemGroup>

<ItemGroup>
Expand Down