Jump to content

Stupidly Simple Feature Request


HeadStand

Recommended Posts

Posted

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.

Posted
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.

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...