Andrew Plummer - Design Development Translation

Example 16: Pagination

Summary

If you're not limiting your rows somehow, pagination is a must for large tables.

Example

View Example

PHP Code

$tg = new TableGear(array( "database" => array( "username" => "USERNAME", "password" => "PASSWORD", "database" => "DATABASE", "table" => "TABLE" ), "sortable" => "all", "editable" => "all", "pagination" => array( "perPage" => 5, "prev" => "Previous", "next" => "Next", "linkCount" => 4, ) "loading" => array( "tag" => "img", "attrib" => array( "src" => "/images/icons/loading.gif", "alt" => "Loading", "class" => "loading" ) ), "formatting" => array( "price" => "currency[prefix=$,pad], "date" => "date" ), "totals" => array("price", "quantity") );

The parameter linkCount refers to the maximum number of links on either side of the current page in the center section.