$table_sort = $query->extend('TableSort')->orderByHeader($header);
$pager = $table_sort->extend('PagerDefault')->limit($pagerLimit);
$result = $pager->execute();
I use this code for pagination,everything is fine until i'm using filter option. Page navigation link is visible even i have only one records which has come from filter by id.
For example:
By default i have 100 records in table,so we can see page navigation link,its good.
The problem is when i try to filter the records by id alone. I got only one record which is matched for given id but still now the pagination link is visible.
$countQuery = $query;
$result = $query->execute();
$Totalcount = $result->rowCount();
$page = pager_default_initialize($Totalcount,$pagerLimit);