24 public function getParams(array $additionParams = []): array
26 $rows = $this->grid->prepareRows();
27 $columns = $this->grid->prepareColumns();
29 $pagination = $this->grid->getPagination();
30 $issetPagination = isset($pagination);
32 $actionsPanel = $this->grid->getPanel();
33 $issetActionsPanel = isset($actionsPanel);
34 $actionsPanelControls =
null;
35 if ($issetActionsPanel)
37 $actionsPanelControls = [
40 'ITEMS' => $actionsPanel->getControls(),
49 $pageSizes = array_map(
50 static function (
int $size) {
52 'NAME' => (string)$size,
53 'VALUE' => (
string)$size,
56 $pagination->getPageSizes()
60 return $additionParams + [
62 'GRID_ID' => $this->grid->getId(),
64 'COLUMNS' => $columns,
66 'NAV_OBJECT' => $pagination,
67 'TOTAL_ROWS_COUNT' => $issetPagination ? $pagination->getRecordCount() : count($rows),
68 'SHOW_PAGINATION' => $issetPagination,
69 'SHOW_TOTAL_COUNTER' =>
true,
70 'PAGE_SIZES' => $pageSizes,
71 'SHOW_PAGESIZE' => $issetPagination,
73 'ACTION_PANEL' => $actionsPanelControls,
74 'SHOW_ACTION_PANEL' => $issetActionsPanel,
75 'SHOW_ROW_CHECKBOXES' => $issetActionsPanel,
76 'SHOW_SELECTED_COUNTER' => $issetActionsPanel,
78 'ALLOW_COLUMNS_SORT' =>
true,
79 'ALLOW_COLUMNS_RESIZE' =>
true,
83 'AJAX_OPTION_JUMP' =>
'N',
84 'AJAX_OPTION_STYLE' =>
'N',
85 'AJAX_OPTION_HISTORY' =>
'N',
87 'HANDLE_RESPONSE_ERRORS' =>
true,
88 'SHOW_GRID_SETTINGS_MENU' =>
true,