gustavnavar / Grid.Blazor

Grid component with CRUD for Blazor (client-side and server-side) and ASP.NET Core MVC
GNU Lesser General Public License v2.1
698 stars 135 forks source link

Configurable visibility of section 'Go To Page' #371

Closed peterM closed 1 year ago

peterM commented 1 year ago

Is here possibility to hide whole section 'Go to' ?

https://github.com/gustavnavar/Grid.Blazor/blob/ce6feec4849bad88e05b325da4c50ffe35ff9f09/GridBlazor/Pages/GridPagerComponent.razor#L64

gustavnavar commented 1 year ago

Package version 4.0.4 implements this feature

peterM commented 1 year ago

perfect... thanks

BahdanauYa commented 1 year ago

When I updated to the last version I don't see pages and "Go To Page" at all. Is this a bug? or hiding is default behaviour now and I should to enable pages somehow

peterM commented 1 year ago

@BahdanauYa try to set in c# property

GridComponent.Grid.Pager.GoToVisibility = true;
BahdanauYa commented 1 year ago

no, doesn't show up

peterM commented 1 year ago

only update what i see in this file is decoration with if statement.

        @if (GridComponent.Grid.Pager.GoToVisibility)
        {
            <div class="grid-goto-page form-group">
                <label class="control-label"><b>@Strings.Goto</b></label>
            <div>
                <input class="form-control grid-goto-page-input" @bind="_currentPage" @onkeyup="GoToKeyup" @onblur="GoToBlur" @onclick:stopPropagation />
            </div>
        </div>
        }

Did you set GridClient and also GridServer option ? Could you post your code ?

gustavnavar commented 1 year ago

Is there any exception issued by the GridPagerComponent?

BahdanauYa commented 1 year ago

I set GridClient and used GridODataClient (not GridServer). I don't see any exceptions.

<GridComponent GridCellCssClass="this-cell-style" T="SomeDto" Grid="@_grid"></GridComponent>
......
private IGridClient<SomeDto> _client;
private CGrid<SomeDto> _grid;
....
_client = new GridODataClient<SomeDto>(httpClient, url, query, false, "someGrid", Columns, 20, CultureInfo.CurrentCulture)
                .ChangePageSize(true)
                .ClearFiltersButton(true)
                .Searchable()
                .Selectable(true)
                .SetStriped(true)
                .WithMultipleFilters()
                .WithGridItemsCount()
                .ODataCrud(false, false, false, false)
                .SetHeaderCrudButtons(true)
                .SetCrudButtonLabels("Add", "View", "View", "Delete")
                .HandleServerErrors(false, true);
            _grid = _client.Grid;
            _grid.Pager.GoToVisibility = true; // tried on new version

This code worked on 4.0.1 but now I see only Show in table footer 1_2RdNRoDJmqfArWaViXal-g

peterM commented 1 year ago

Strange ... I do not know what can cause it .. unfortunately i am not able to try it personally.

gustavnavar commented 1 year ago

I can not reproduce your issue. I've just tested your grid configuration and it works fine: Captura (195)

I don't understand what's going on.