Overriding default number of records per list page

A place for users and developers of the Xataface to discuss and receive support.

Overriding default number of records per list page

Postby dbuckley » Sat Apr 04, 2009 11:45 pm

The default of 30 records is fine most of the time, but how do I override that for a particular table? I found the global Dataface_QueryTool_limit which I think sets that number for all tablesbut that isn't what I want.

Thanks.
dbuckley
 
Posts: 2
Joined: Sat Apr 04, 2009 11:42 pm

Postby sophistry » Sun Apr 05, 2009 7:05 am

I believe you can set your default page limit by setting the default_limit parameter in your conf.ini file.

more information here...
http://xataface.com/wiki/conf.ini_file

Rory
sophistry
 
Posts: 27
Joined: Mon May 19, 2008 11:20 am

Postby dbuckley » Sun Apr 05, 2009 10:45 am

Hi Rory.

Yes, that appears to set the overall default, but thats not what I'm trying to acheive - I want to set it on a table by table basis.
dbuckley
 
Posts: 2
Joined: Sat Apr 04, 2009 11:42 pm

Postby shannah » Sun Apr 12, 2009 10:56 am

Many ways to do this. The key is to understand that the '-limit' GET parameter controls this, so you can set this programmatically to set the limit.

One way is to add something like the following to the beginning of your index.php file:
Code: Select all
if ( !$_POST and !@$_GET['-limit'] ){
    if ( @$_GET['-table'] == 'table1' ){
        $_GET['-limit'] = $_REQUEST['-limit'] = 10;
    } else if ( @$_GET['-table'] == 'table2' ){
        $_GET['-limit'] = $_REQUEST['-limit'] = 20;
    }
    etc...

}
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 5 guests

cron
Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved