Page 1 of 1

Overriding default number of records per list page

PostPosted: Sat Apr 04, 2009 11:45 pm
by dbuckley
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.

PostPosted: Sun Apr 05, 2009 7:05 am
by sophistry
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

PostPosted: Sun Apr 05, 2009 10:45 am
by dbuckley
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.

PostPosted: Sun Apr 12, 2009 10:56 am
by shannah
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...

}