Blazor.FlexGrid: Trigger Reload to Fetch Data with Lazy

I have code like this. When I click Apply Filters I want the grid to fire back to the API endpoint with the added Request Parm. How do I do this?

<form class="form-inline">
	<div class="form-group mb-2">
		<label for="temp">Temp</label>
		<input type="text" class="form-control" @bind="@Name" />
	</div>

	<button type="button" onclick="@ApplyFilters" class="btn btn-primary mb-2">Apply Filters</button>
</form>

<GridView DataAdapter="@forecastAdapter" LazyLoadingOptions="@lazyLoadingOptions" PageSize="10"></GridView>

@code {

	LazyLoadingOptions lazyLoadingOptions { get; set; }
	private string Name { get; set; };

	protected override async Task OnInitAsync()
	{
		lazyLoadingOptions = new LazyLoadingOptions() { DataUri = "https://localhost:44366/demo/WeatherForecasts" };
	}

	private void ApplyFilters()
	{
		lazyLoadingOptions.RequestParams.Add("Search", "SearchString");
	}
}

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 15 (9 by maintainers)

Most upvoted comments

Yeah Ok, also you can suggest how to solve this and use pull request.