DxDataGrid Paging Toggling
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.
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>
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.