This documentation explained how to update both dataSource and columns simultaneously in grid.
Usually grid column and datasource are updated using columns and dataSource methods respectively.
But updating those one after another will cause the DOM to update twice and in case of remote databinding in grid, it would send two requests to server-side. This can be optimized by using columns property instead of columns methods and then finally call dataSource method to provide the dataSource to Grid.
1. Render the Grid control.
Button click event
2. Changed the Grid dataSource and columns
The following output is displayed the above behavior
Fig1: Initial grid rendering
Fig2: After the button click
This page will automatically be redirected to the sign-in page in 10 seconds.