I'm trying to show 2 tables in the same page, everything goes fine except for the pagination part, table reloads without changing contents...
Even I use different paginationKey and different sortKey for both tables, but pagination is broken, is it a bug? or am I missing something?
Code:
/* First Table */
$table_1 = new \IPS\Helpers\Table\Db('first_table', \IPS\Request::i()->url(), array() );
$table_1->include = array( 'col1', 'col2', 'col3');
$table_1->mainColumn = 'col1';
$table_1->parsers = array(
'col2' => function ($val, $row) {
return \IPS\DateTime::ts($val);
}
);
$table_1->sortBy = $table_1->sortBy ?: 'col2';
$table_1->sortDirection = $table_1->sortDirection ?: 'desc';
$table_1->limit = 5;
$table_1->rowsTemplate = array( \IPS\Theme::i()->getTemplate( 'tables', 'core', 'admin' ), 'rows' );
$table_1->tableTemplate = array( \IPS\Theme::i()->getTemplate( 'tables', 'core', 'admin' ), 'table' );
$table_1->paginationKey = 'firstTablePage';
$table_1->resortKey = 'firstTableResort';
/* Second Table */
$table_2 = new \IPS\Helpers\Table\Db('second_table', \IPS\Request::i()->url(), array() );
$table_2->include = array( 'col1', 'col2', 'col3');
$table_2->mainColumn = 'col1';
$table_2->parsers = array(
'col2' => function ($val, $row) {
return \IPS\DateTime::ts($val);
}
);
$table_2->sortBy = $table_2->sortBy ?: 'col2';
$table_2->sortDirection = $table_2->sortDirection ? : 'desc';
$table_2->limit = 5;
$table_2->rowsTemplate = array( \IPS\Theme::i()->getTemplate( 'tables', 'core', 'admin' ), 'rows' );
$table_2->tableTemplate = array( \IPS\Theme::i()->getTemplate( 'tables', 'core', 'admin' ), 'table' );
$table_2->paginationKey = 'secondTablePage';
$table_2->resortKey = 'secondTableResort';
return \IPS\Theme::i()->getTemplate( 'tempGroup', 'temp' )->browse( (string) $table_1, (string) $table_2 );