Answer the question
In order to leave comments, you need to log in
How to count pages in main.ui.grid navigation?
Colleagues, I want to use the Bitrix grid in public.
Data in ORM, output.
I pass NAV_OBJECT to the grid, formed as follows:
$grid_options = new Bitrix\Main\Grid\Options('my_list');
$sort = $grid_options->GetSorting(['sort' => ['NAME' => 'DESC'], 'vars' => ['by' => 'by', 'order' => 'order']]);
$nav_params = $grid_options->GetNavParams();
$nav = new Bitrix\Main\UI\PageNavigation('my_list_nav');
$nav->allowAllRecords(true)
->setPageSize($nav_params['nPageSize'])
->initFromUri();
Answer the question
In order to leave comments, you need to log in
The answer is here
https://dev.1c-bitrix.ru/learning/course/index-new...
$nav->setRecordCount($controlsRes->getCount()); - it is necessary to set the total number of entries.
It was floating somewhere in the back of consciousness)
I was pleased with the documentation as usual) This method is not here.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question