devextreme-angular icon indicating copy to clipboard operation
devextreme-angular copied to clipboard

DxDataGrid Paging Toggling

Open Angelminster opened this issue 10 years ago • 2 comments

When i Change Paging enabled/disable the grid doesn't refresh properly. I have to change the datasource to get it working.

Calling repaint() and/or refresh() doesn't work.

Angelminster avatar Jun 28 '16 17:06 Angelminster

It looks like your variable that should enable paging is not directly bound in markup. In that case, the Angular 2 change detection strategy doesn't watch for variable changes. The code below works correctly for me:

<dx-data-grid
    [columns]='[ "CompanyName" ]'
    [dataSource]='customers'
    [paging]='{
        enabled: pagingEnabled,
        pageSize: 10
    }'
    [pager]= '{
        showPageSizeSelector: true,
        allowedPageSizes: [5, 10, 20],
        showInfo: true
    }'
>
</dx-data-grid>
<dx-button text="Switch Paging" (onClick)="pagingEnabled = !pagingEnabled"></dx-button>

dxbykov avatar Jun 29 '16 12:06 dxbykov

Your Example works as expected.

I was using some work around to change de instance options without markup. Something like:

this.dataGrid.instance._options.groupPanel.visible = this.dxDataGridOptions.groupPanel.visible;

It works for all options that i've tried (filterRow, groupPanel, pager, etc). Not for paging and not for editing. I've changed my code and its working.

Thank You.

Angelminster avatar Jun 29 '16 13:06 Angelminster