This topic is locked

Get total number of records in a List grid

1/13/2023 4:48:30 AM
PHPRunner General questions
M
Mauipm author

Hi,
I know it's a really trivial question, but I dont know how to get the total number of rows in a list (Before display).
I would like to hide some page elements if the "total" number of records is less than a certain value...but the "total" ????

Mauro

francesco 1/22/2023

if you use total from designer screen, you'll obtain total of all fields also if you hide some if them. You'll need a code snippet for that or use a sql query to filter results before total sum

fhumanes 1/23/2023

Hello,

In the "Before Display" event, you can include these sentences:

$numEndPage = $xt->xt_vars['last_shown'];
$numLast = $xt->xt_vars['lastrecord'];

You will obtain the last record of current page and the total number of Query's records.

Regards,
fernando

jadachDevClub member 1/23/2023
----------------------------------------------------------
tName -> List page -> before Display
----------------------------------------------------------
if( pageObject.numRowsFromSQL > 30000 )
pageObject.hideItem("export");