Grid object.
Contains all the necessary information to work with the grid: columns, settings, actions. There is no work with the filter here, there is a separate Filter
class for this.
- См. также
- \Bitrix\Main\Filter\Filter
Usage example:
$settings = new \Bitrix\Main\Grid\Settings([
'ID' => 'test-grid',
]);
$grid =
new Grid($settings);
$totalCount = Entity::getCount(
$grid->getOrmFilter() ?? []
);
$grid->initPagination($totalCount);
$grid->processRequest();
$grid->setRawRows(
Entity::getList($grid->getOrmParams())
);
$APPLICATION->IncludeComponent(
'bitrix:main.ui.grid',
'',
\
Bitrix\Main\
Grid\Component\ComponentParams::get($grid, [
])
);
См. определение в файле grid.php строка 73
initPagination |
( |
int | $totalRowsCount, |
|
|
?string | $navId = null ) |
Init pagination.
If you use pagination, you need to call this method before processing the request (processRequest
method) and getting the ORM parameters (getOrmParams
method).
Ideally, call it immediately after creating the grid instance.
- Аргументы
-
int | $totalRowsCount | |
string | null | $navId | |
- Возвращает
- void
См. определение в файле grid.php строка 208