Pager markup is not removed from DOM on grid reload

I am facing an issue with dhtmlx grid. I have enabled pagination for my grid. Whenever I am trying to reload the grid with new data(or the old), entire grid markup is being refreshed which is expected. The problem I am getting is that old copy of pagination div and its inner HTML is not removed from the DOM. The number of times I reload the grid, I am seeing the those many instances of the pagination upon inspection of DOM.

Things become worse when I have large number of records in the grid say 200,000. This will create 2000 page numbers in the page selector in the pagination bar.

Unfortunately the clearing the grid is not clearing the paging area.
After the grid is cleared you can clear the html content of the paging container manually.