So in our example, I want to show 50 records when the user is using a mobile and 100 when using a computer or laptop
- First step go to the hooks folder
- Find your tablename.php - table name is the name of the actual table file you are looking for
- Inside the tablename_init function just above return TRUE add this code
Code: Select all
//detect user device type
$isMobile = (bool) strpos($_SERVER['HTTP_USER_AGENT'], 'Mobile');
$options->RecordsPerPage = $isMobile ? 50 : 100;