NetTalk Central

Author Topic: Records per Page  (Read 2744 times)

jtailleur

  • Newbie
  • *
  • Posts: 32
    • View Profile
    • Email
Records per Page
« on: January 25, 2012, 04:00:36 PM »
Is there any way to set the records per page differently for mobile vs. normal browser mode?


Joe.

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Records per Page
« Reply #1 on: January 25, 2012, 11:44:11 PM »
I suspect this sort of question is going to be increasingly common in the time to come.
the generic answer is something like this;

The "lines per page" is an expression.
The Clarion CHOOSE command let's you place an "IF" statement inside an expression.
the p_web.IsMobile() method tells you if it's mobile or not.

so, in your case, the "Lines per page" expression becomes something like

CHOOSE(p_web.IsMobile()>0,5,10)

Where 5 is the number of lines for mobile, and 10 is for desktop.
Also - do not be tempted to drop the >0 part of the expression - it's important.

cheers
Bruce

jtailleur

  • Newbie
  • *
  • Posts: 32
    • View Profile
    • Email
Re: Records per Page
« Reply #2 on: January 26, 2012, 07:32:10 AM »
Very, very, slick.  :)

Exactly what I wanted; thanks Bruce.


Joe.