Component parameters
Below are all grid component parameters (main.ui.grid).
Required parameters
Parameter | Type | Description |
---|---|---|
GRID_ID | string | Grid identifier, unique for each grid within a single page. |
COLUMNS | array | Set of Grid columns. |
ROWS | array | Grid rows. |
AJAX_MODE | string | Value must have set as Y. |
AJAX_OPTION_JUMP | string | Value must have set as N. |
AJAX_OPTION_HISTORY | string | Value must have set as N. |
Additional parameters
Parameter | Type | Description |
---|---|---|
NAV_STRING | string | Page navigation as HTML string. |
NAV_OBJECT | \Bitrix\Main\UI\PageNavigation / CDBResult | Page navigation page or CDBResult object. |
~NAV_PARAMS | array | Parameters for page navigation component (main.pagenavigation). Used jointly with the parameter NAV_OBJECT. |
NAV_PARAM_NAME | string | Parameter name to pass page number. |
CURRENT_PAGE | int | Current page number. Necessary for correct operation of the "Load more" button. |
ENABLE_NEXT_PAGE | boolean | Defines, if the next page is available. Parameter is needed for correct operation of the "Load more" button. |
ENABLE_COLLAPSIBLE_ROWS | boolean | Enables a collapsible rows grouping. |
TOTAL_ROWS_COUNT | int | Number of rows on all pages. |
TOTAL_ROWS_COUNT_HTML | string | Allows printing a custom counter with general number of rows. For example, just as in CRM, where total string count is displayed with a lazy loading upon clicking on a link. |
PAGE_SIZES | array | Array with items for drop-down list with selection of page size.
'PAGE_SIZES' => [ [ 'NAME' => 20, 'VALUE' => 20, ], [ 'NAME' => 40, 'VALUE' => 40, ], ..., ], |
SETTINGS_WINDOW_TITLE | string | Title for grid settings popup. |
COLUMNS_ALL_WITH_SECTIONS | array | List with columns with sections, for grid settings popup. |
HEADERS_SECTIONS | array | Column sections for grid settings popup. |
ENABLE_FIELDS_SEARCH | string | Enables option to search columns in grid settings. |
TOP_ACTION_PANEL_RENDER_TO | string | Defines where to display BX.UI.ActionPanel. Receives function name as value which returns link to DOM element. |
TOP_ACTION_PANEL_PINNED_MODE | string | Defines parameter pinnedMode, for BX.UI.ActionPanel. |
TOP_ACTION_PANEL_CLASS | string | Defines CSS class for BX.UI.ActionPanel. |
ACTION_PANEL | array | Set of actions/elements for panel containing group actions, or for BX.UI.ActionPanel. |
ACTION_PANEL_OPTIONS | array | Additional parameters for BX.UI.ActionPanel. As of the moment, only available parameter is MAX_HEIGHT. |
DEFAULT_PAGE_SIZE | int | Page size by default. |
STUB | string / array | Empty grid stub. Can receive HTML string, or an array.
'STUB' => [ 'title' => string, 'description' => string, ], |
LAZY_LOAD | array | Enables lazy loading for list of columns.
'LAZY_LOAD' => [ 'CONTROLLER' => 'my.controller.name', ], |
SHOW_CHECK_ALL_CHECKBOXES | boolean | Allows displaying "Select all" checkbox. |
SHOW_ROW_CHECKBOXES | boolean | Allows displaying checkboxes for rows. |
SHOW_ROW_ACTIONS_MENU | boolean | Allows displaying row actions menu. |
SHOW_GRID_SETTINGS_MENU | boolean | Allows displaying grid settings menu (button with cogwheel). |
SHOW_MORE_BUTTON | boolean | Allows displaying "Load more" button. |
SHOW_NAVIGATION_PANEL | boolean | Allows displaying navigation panel button. (Page navigation, size and etc.) |
SHOW_PAGINATION | boolean | Allows displaying page navigation. |
SHOW_SELECTED_COUNTER | boolean | Allows displaying selected rows counter. |
SHOW_TOTAL_COUNTER | boolean | Allows displaying total rows counter on all pages. |
SHOW_PAGESIZE | boolean | Allows displaying drop-down list with selection of page size. |
SHOW_ACTION_PANEL | boolean | Allows displaying group actions panel. |
SHOW_GROUP_EDIT_BUTTON | boolean | Allows displaying standard "Edit" button at the group action panel. |
SHOW_GROUP_DELETE_BUTTON | boolean | Allows displaying standard "Delete" button at the group action panel. |
SHOW_SELECT_ALL_RECORDS_CHECKBOX | boolean | Displays or hides checkbox with selection of all rows, on all pages. By default, checkbox is hidden. |
ALLOW_COLUMNS_SORT | boolean | Allows sorting columns by drag-and-dropping. |
ALLOW_ROWS_SORT | boolean | Allows sorting of rows by drag-and-dropping. |
ALLOW_ROWS_SORT_IN_EDIT_MODE | boolean | Allows row sorting by editing in a inline editing mode. |
ALLOW_EDIT_SELECTION | boolean | Allows selecting rows in the inline editing mode. |
ALLOW_ROWS_SORT_INSTANT_SAVE | boolean | Allows saving rows sorting immediately after drag-and-dropping them. |
ALLOW_STICKED_COLUMNS | boolean | Allows pinning columns with parameter sticked during horizontal scrolling. |
ALLOW_COLUMNS_RESIZE | boolean | Allows changing column size. |
ALLOW_HORIZONTAL_SCROLL | boolean | Allows horizontal scrolling, if grid doesn't fit by width. |
ALLOW_SORT | boolean | Allows sorting upon clicking at column title. |
ALLOW_PIN_HEADER | boolean | Allows pining grid header to the browser's window top on scrolling. |
ALLOW_INLINE_EDIT | boolean | Allows inline editing for rows. |
ALLOW_CONTEXT_MENU | boolean | Allows printing context menu on right mouse button clicking on the string. |
HANDLE_RESPONSE_ERRORS | boolean | Enables mode for additional response processing. In this mode, grid checks, if the backend's response will contain the messages array. If yes, grid displays these messages in a popup.
Please note, that despite the parameter is named HANDLE_RESPONSE_ERRORS, messages contain details not only about errors, but on successful saving and etc. 'messages' => [ [ 'TITLE' => string, 'TEXT' => string, 'TYPE' => 'error' | 'warning' | 'info' | 'success', ], ..., ], |
ALLOW_VALIDATE | boolean | Enables validation mode for saved values during inline editing. In this mode, before sending query for saving, sends an additional query validate. In case, response doesn't contain the array messages or it's empty - the grid then executes the next query for saving. Otherwise, grid will print a popup with messages from messages. |
TILE_GRID_MODE | boolean | Enables grid display. |
JS_CLASS_TILE_GRID_ITEM | boolean | Allows redefining JS-class for element. |
ROW_LAYOUT | array | Declarative template of the row. Allows printing rows with complex layout into the grid, with rowspan and colspan.
$rowLayout = [ [ ['column' => 'col_0', 'rowspan' => 2], ['column' => 'col_1'], ['column' => 'col_2'], ['column' => 'col_3'] ], [ ['data' => 'data_field_5', 'colspan' => 3], ], ]; Such template must be equivalent to HTML layout. <tr> <td rowspan="2"></td> <td></td> <td></td> <td></td> </tr> <tr> <td colspan="3"></td> </tr> |
© «Bitrix24», 2001-2024