1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
Класс Grid
Граф наследования:Grid:
TabletGrid

Открытые члены

 __construct (Settings $settings)
 getId ()
 getSettings ()
 getOptions ()
 getColumns ()
 getRows ()
 getPanel ()
 getFilter ()
 getPagination ()
 setRawRows (iterable $rawValue)
 prepareRows ()
 prepareColumns ()
 processRequest (?HttpRequest $request=null)
 getOrmParams ()
 getOrmSelect ()
 getOrmFilter ()
 getOrmOrder ()
 getVisibleColumnsIds ()

Защищенные члены

 getRawRows ()
 getActions ()
 getActionById (string $id)
 processGridActionsRequest (GridRequest $request)
 getDefaultSorting ()
 createColumns ()
 createRows ()
 createPanel ()
 createFilter ()
 createPagination ()

Защищенные данные

GridRequestFactory $gridRequestFactory
GridResponseFactory $gridResponseFactory

Подробное описание

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:

//
// create instances for grid and filter
//
$settings = new \Bitrix\Main\Grid\Settings([
'ID' => 'test-grid',
]);
$grid = new Grid($settings);
//
// processing grid actions from current request
//
$grid->processRequest();
//
// set all records count for pagination (if using)
//
$grid->getPagination()->setRecordCount(
Entity::getCount(
$grid->getOrmFilter() ?? []
)
);
//
// fill grid rows with raw data
// It is important to do this AFTER processing the request, because the handlers could change the data.
//
$grid->setRawRows(
Entity::getList($grid->getOrmParams())
);
//
// render component
//
$APPLICATION->IncludeComponent(
'bitrix:main.ui.grid',
'',
\Bitrix\Main\Grid\Component\ComponentParams::get($grid, [
// additional params
])
);
global $APPLICATION
Определения include.php:80

См. определение в файле grid.php строка 74

Конструктор(ы)

◆ __construct()

__construct ( Settings $settings)
Аргументы
Settings$settingsrequired for all childs!

См. определение в файле grid.php строка 98

Методы

◆ createColumns()

createColumns ( )
abstractprotected

Create columns collection.

Возвращает
Columns

Переопределяется в TabletGrid.

◆ createFilter()

createFilter ( )
protected

Create filter.

Возвращает
Filter|null

См. определение в файле grid.php строка 555

◆ createPagination()

createPagination ( )
protected

Create pagination.

In most cases, you can use PaginationFactory for create pagination.

См. также
\Bitrix\Main\Grid\Pagination\PaginationFactory
Возвращает
PageNavigation|null

См. определение в файле grid.php строка 569

◆ createPanel()

createPanel ( )
protected

Create panel.

Возвращает
Panel|null

См. определение в файле grid.php строка 545

◆ createRows()

createRows ( )
protected

Create rows collection.

Возвращает
Rows

См. определение в файле grid.php строка 529

◆ getActionById()

getActionById ( string $id)
finalprotected

Grid action.

Аргументы
string$id
Возвращает
Action|null

См. определение в файле grid.php строка 415

◆ getActions()

getActions ( )
protected

Grid actions.

These are the actions of the grid itself, and not its component parts (rows, panel, ...).

Возвращает
Action[]

См. определение в файле grid.php строка 395

◆ getColumns()

getColumns ( )
final

Grid columns.

Возвращает
Columns

См. определение в файле grid.php строка 144

◆ getDefaultSorting()

getDefaultSorting ( )
protected

Default sorting.

Возвращает
array

См. определение в файле grid.php строка 510

◆ getFilter()

getFilter ( )
final

Grid filter.

Возвращает
Filter|null

См. определение в файле grid.php строка 180

◆ getId()

getId ( )
final

Grid id.

Возвращает
string

См. определение в файле grid.php строка 112

◆ getOptions()

getOptions ( )
final

User options.

Возвращает
Options

См. определение в файле grid.php строка 132

◆ getOrmFilter()

getOrmFilter ( )

Filter for ORM and getList method.

См. также
\Bitrix\Main\ORM\Data\DataManager method getList
Возвращает
array|null is filter not setted, returns null

См. определение в файле grid.php строка 358

◆ getOrmOrder()

getOrmOrder ( )

Order for ORM and getList method.

См. также
\Bitrix\Main\ORM\Data\DataManager method getList
Возвращает
array

См. определение в файле grid.php строка 376

◆ getOrmParams()

getOrmParams ( )

Params for ORM and getList method.

См. также
\Bitrix\Main\ORM\Data\DataManager method getList
Возвращает
array

См. определение в файле grid.php строка 314

◆ getOrmSelect()

getOrmSelect ( )

Select for ORM and getList method.

См. также
\Bitrix\Main\ORM\Data\DataManager method getList
Возвращает
array

См. определение в файле grid.php строка 344

◆ getPagination()

getPagination ( )
final

Grid pagination.

Возвращает
PageNavigation|null

См. определение в файле grid.php строка 192

◆ getPanel()

getPanel ( )
final

Grid footer actions panel.

Возвращает
Panel|null

См. определение в файле grid.php строка 168

◆ getRawRows()

getRawRows ( )
finalprotected

Get raw rows.

Возвращает
array

См. определение в файле grid.php строка 221

◆ getRows()

getRows ( )
final

Grid rows.

Возвращает
Rows

См. определение в файле grid.php строка 156

◆ getSettings()

getSettings ( )
final

Configuration settings.

Возвращает
Settings

См. определение в файле grid.php строка 122

◆ getVisibleColumnsIds()

getVisibleColumnsIds ( )

Ids of visible columns.

If the user's display options are filled in, they are used. Otherwise, used default columns.

Возвращает
string[] columns ids

См. определение в файле grid.php строка 486

◆ prepareColumns()

prepareColumns ( )

Gets columns prepared for output.

Возвращает
Column[]

См. определение в файле grid.php строка 241

◆ prepareRows()

prepareRows ( )

Gets rows prepared for output.

Возвращает
array[]

См. определение в файле grid.php строка 231

◆ processGridActionsRequest()

processGridActionsRequest ( GridRequest $request)
protected

Processing only grid actions.

См. также
::processRequest for processing all actions (grid, rows and panel).
Аргументы
GridRequest$request
Возвращает
GridResponse|null

См. определение в файле grid.php строка 444

◆ processRequest()

processRequest ( ?HttpRequest $request = null)

Processing all actions of the grid.

Handles actions of the grid, panel, and rows.

Аргументы
HttpRequest | null$request
Возвращает
void

См. определение в файле grid.php строка 262

◆ setRawRows()

setRawRows ( iterable $rawValue)

Set raw rows (only data).

Аргументы
iterable$rawValue
Возвращает
void

См. определение в файле grid.php строка 206

Поля

◆ $gridRequestFactory

GridRequestFactory $gridRequestFactory
protected

См. определение в файле grid.php строка 92

◆ $gridResponseFactory

GridResponseFactory $gridResponseFactory
protected

См. определение в файле grid.php строка 93


Объявления и описания членов класса находятся в файле:
  • C:/bitrix/modules/main/lib/grid/grid.php