HeadStand Posted June 16, 2017 Posted June 16, 2017 I am using a custom table to show data that is pulled from an API. The problem is that the API does not tell me how many how many records I'm going to get, only whether another page exists. Can we get a flag on the table class to trigger simple pagination? Right now the output is buried in \IPS\Helpers\Table::__toString \IPS\Output::i()->json( array( 'rows' => $rowHtml, 'pagination' => \IPS\Theme::i()->getTemplate( 'global', 'core', 'global' )->pagination( $this->baseUrl, $this->pages, $this->page, $this->limit, TRUE, $this->paginationKey ), 'extraHtml' => $this->extraHtml ) ); Since it calls the json method, there is no room for a hook point here. My only option (that I can think of) is to override the pagination template and check the base URL if it matches. If we can just get a property on the Table class, that would be awesome. Thanks.
bfarber Posted June 16, 2017 Posted June 16, 2017 Am I understanding correctly that you want that hardcoded TRUE to be a class property instead, basically, so that you have better control over it?
HeadStand Posted June 16, 2017 Author Posted June 16, 2017 41 minutes ago, bfarber said: Am I understanding correctly that you want that hardcoded TRUE to be a class property instead, basically, so that you have better control over it? No. The pagination template has a parameter at the end that is $simple=false. It's not referenced here at all, so it always uses the default. The TRUE here is for the $ajax parameter.
bfarber Posted June 19, 2017 Posted June 19, 2017 We'll take a look and see. Thanks for the suggestion.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.