Example #1
0
        async Task DebounceFilter()
        {
            if (!LoadData.HasDelegate)
            {
                searchText = await JSRuntime.InvokeAsync <string>("Radzen.getInputValue", search);

                _view = null;
                if (IsVirtualizationAllowed())
                {
#if NET5
                    if (virtualize != null)
                    {
                        await virtualize.RefreshDataAsync();
                    }
                    await InvokeAsync(() => { StateHasChanged(); });
#endif
                }
                else
                {
                    await InvokeAsync(() => { StateHasChanged(); });
                }
            }
            else
            {
                if (IsVirtualizationAllowed())
                {
#if NET5
                    if (virtualize != null)
                    {
                        await InvokeAsync(virtualize.RefreshDataAsync);
                    }
                    await InvokeAsync(() => { StateHasChanged(); });
#endif
                }
                else
                {
                    await LoadData.InvokeAsync(await GetLoadDataArgs());
                }
            }

            await JSRuntime.InvokeAsync <string>("Radzen.repositionPopup", Element, PopupID);
        }
Example #2
0
        /// <summary>
        /// Instructs the component to re-request data from its <see cref="DataProvider"/>.
        /// This is useful if external data may have changed.
        /// </summary>
        /// <returns>A <see cref="Task"/> representing the completion of the operation.</returns>
        public async Task RefreshDataAsync()
        {
            switch (ContentNavigationModeEffective)
            {
            case GridContentNavigationMode.Pagination:
                await RefreshPaginationDataCoreAsync();

                break;

            case GridContentNavigationMode.InfiniteScroll:
                if (infiniteScrollVirtualizeComponent != null)
                {
                    await infiniteScrollVirtualizeComponent.RefreshDataAsync();
                }
                // when infiniteScrollVirtualizeComponent, it will be rendered and data loaded so no action here is required
                break;

            default: throw new InvalidOperationException(ContentNavigationModeEffective.ToString());
            }
        }