Answer the question
In order to leave comments, you need to log in
How to call pagination for your orm object in the site admin?
I'm making a custom page in the admin panel.
Can't get pagination to work.
Page Code
<?
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_admin_before.php");
$adminPage->Init();
$adminMenu->Init($adminPage->aModules);
if(empty($adminMenu->aGlobalMenu))
$APPLICATION->AuthForm(GetMessage("ACCESS_DENIED"));
$APPLICATION->SetAdditionalCSS("/bitrix/themes/".ADMIN_THEME_ID."/index.css");
$APPLICATION->SetTitle("Заголовок страницы");
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_admin_after.php");
$nav = new \Bitrix\Main\UI\AdminPageNavigation("my_table_id");
$cultureList = Custom\Orm\MyLogTable::getList([
'order'=>['ADD_DATE_TIME'=>'DESC'],
'count_total' => true,
'limit' => $nav->getLimit(),
'offset' => $nav->getOffset()]);
$nav->setRecordCount($cultureList->getCount());
?>
<table class="adm-list-table">
<tbody>
<? while ($item = $cultureList->fetch() ) {?>
<!--Карточки объектов-->
<?}?>
</tbody>
</table>
<?
$APPLICATION->IncludeComponent(
"bitrix:main.pagenavigation",
"admin",
array(
"NAV_OBJECT" => $nav,
"TABLE_ID" => "my_table_id",
"SEF_MODE" => "N",
"SHOW_COUNT" => "Y",
),
false
);
require($_SERVER["DOCUMENT_ROOT"].BX_ROOT."/modules/main/include/epilog_admin.php");
?>
Answer the question
In order to leave comments, you need to log in
How "So-so" solution helped to change the template to '.default' and "SEF_MODE" => "N"
and the number of elements on the page can be controlled via $nav->setPageSize().
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question