MetaFox

DataGrid extends GridConfig
in package

Class DataGrid.

Tags
codeCoverageIgnore
driverName

storage.disk

Table of Contents

Properties

$actions  : Actions|null
$additionalSection  : array<string, mixed>|null
$apiParams  : array<string|int, mixed>|array<string|int, string>
$apiRules  : array<string|int, mixed>|array<string|int, array<string|int, mixed>>
$appName  : string
$attributes  : array<string, mixed>
$batchActionMenu  : BatchActionMenu|null
$columns  : GridColumns
$dataSource  : array<string|int, mixed>|null
$gridActionMenu  : GridActionMenu|null
$isAdminCP  : bool
$itemActionMenu  : ItemActionMenu|null
$resourceName  : string
$searchForm  : AbstractForm|null

Methods

__construct()  : mixed
GridConfig constructor.
additionalSection()  : self
dynamicRowHeight()  : $this
enableCheckboxSelection()  : $this
Add a checkbox section on the first cell of each row.
inlineSearch()  : $this
Enable inline search fields.
isHidden()  : self
rowHeight()  : static
searchFormPlacement()  : $this
setAttribute()  : $this
setDataSource()  : $this
Assign data source.
setDefaultDataSource()  : mixed
setRowsPerPage()  : $this
setSearchForm()  : void
sortable()  : $this
title()  : GridConfig
toArray()  : array<string, mixed>
useAdminSearchForm()  : $this
withActions()  : void
Assign actions <code> $grid->withAction(function(Actions $actions){ $actions->add('editItem')->url(); }) </code>.
withBatchMenu()  : void
withColumns()  : void
Handle columns process.
withGridMenu()  : void
withItemMenu()  : void
Assign actions <code> $grid->withItemMenu(function(ItemActionMenu $menu){ $menu->add() }) </code>.
addColumn()  : GridColumn
Add new column by field.
initialize()  : void

Properties

$additionalSection

protected array<string, mixed>|null $additionalSection = null

$apiParams

protected array<string|int, mixed>|array<string|int, string> $apiParams = ['q' => ':q']

$apiRules

protected array<string|int, mixed>|array<string|int, array<string|int, mixed>> $apiRules = ['q' => ['truthy', 'q']]

$appName

protected string $appName = 'storage'

$attributes

protected array<string, mixed> $attributes = ['rowHeight' => 48]

$dataSource

protected array<string|int, mixed>|null $dataSource = null

$resourceName

protected string $resourceName = 'disk'

$searchForm

protected AbstractForm|null $searchForm = null

Methods

__construct()

GridConfig constructor.

public __construct(string $resource) : mixed
Parameters
$resource : string

additionalSection()

public additionalSection(array<string|int, mixed> $data) : self
Parameters
$data : array<string|int, mixed>
Return values
self

dynamicRowHeight()

public dynamicRowHeight() : $this
Return values
$this

set free height to skip react-window

enableCheckboxSelection()

Add a checkbox section on the first cell of each row.

public enableCheckboxSelection([bool $enabled = true ]) : $this
Parameters
$enabled : bool = true
Return values
$this

inlineSearch()

Enable inline search fields.

public inlineSearch(array<string|int, string> $inlineSearch) : $this
Parameters
$inlineSearch : array<string|int, string>
Return values
$this

isHidden()

public isHidden([bool $value = true ]) : self
Parameters
$value : bool = true
Return values
self

rowHeight()

public rowHeight(int $rowHeight) : static
Parameters
$rowHeight : int
Return values
static

searchFormPlacement()

public searchFormPlacement([string $location = 'top' ]) : $this
Parameters
$location : string = 'top'
Return values
$this

setAttribute()

public setAttribute(string $name, mixed $value) : $this
Parameters
$name : string
$value : mixed
Return values
$this

setDataSource()

Assign data source.

public setDataSource(string $apiUrl[, array<string|int, mixed>|array<string|int, string> $apiParams = ['q' => ':q'] ][, array<string|int, mixed> $apiRules = ['q' => ['truthy', 'q']] ]) : $this
Parameters
$apiUrl : string
$apiParams : array<string|int, mixed>|array<string|int, string> = ['q' => ':q']
$apiRules : array<string|int, mixed> = ['q' => ['truthy', 'q']]
Return values
$this

setDefaultDataSource()

public setDefaultDataSource() : mixed

setRowsPerPage()

public setRowsPerPage(int $rowsPerPage[, array<string|int, mixed> $options = [] ]) : $this
Parameters
$rowsPerPage : int
$options : array<string|int, mixed> = []
Return values
$this

setSearchForm()

public setSearchForm(AbstractForm|null $searchForm) : void
Parameters
$searchForm : AbstractForm|null

sortable()

public sortable([bool $value = true ]) : $this
Parameters
$value : bool = true
Return values
$this

toArray()

public toArray(Request $request) : array<string, mixed>
Parameters
$request : Request
Return values
array<string, mixed>

useAdminSearchForm()

public useAdminSearchForm() : $this
Return values
$this

withActions()

Assign actions <code> $grid->withAction(function(Actions $actions){ $actions->add('editItem')->url(); }) </code>.

public withActions(Closure $closure) : void
Parameters
$closure : Closure

withBatchMenu()

public withBatchMenu(Closure $closure) : void
Parameters
$closure : Closure

withColumns()

Handle columns process.

public withColumns(Closure $closure) : void
Parameters
$closure : Closure

withGridMenu()

public withGridMenu(Closure $closure) : void
Parameters
$closure : Closure

withItemMenu()

Assign actions <code> $grid->withItemMenu(function(ItemActionMenu $menu){ $menu->add() }) </code>.

public withItemMenu(Closure $closure) : void
Parameters
$closure : Closure

initialize()

protected initialize() : void

        
On this page

Search results