DataGrid
extends GridConfig
in package
Class DataGrid.
Tags
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
$actions
protected
Actions|null
$actions
= null
$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]
$batchActionMenu
protected
BatchActionMenu|null
$batchActionMenu
= null
$columns
protected
GridColumns
$columns
$dataSource
protected
array<string|int, mixed>|null
$dataSource
= null
$gridActionMenu
protected
GridActionMenu|null
$gridActionMenu
= null
$isAdminCP
protected
bool
$isAdminCP
= true
$itemActionMenu
protected
ItemActionMenu|null
$itemActionMenu
= 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
selfdynamicRowHeight()
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
$thisinlineSearch()
Enable inline search fields.
public
inlineSearch(array<string|int, string> $inlineSearch) : $this
Parameters
- $inlineSearch : array<string|int, string>
Return values
$thisisHidden()
public
isHidden([bool $value = true ]) : self
Parameters
- $value : bool = true
Return values
selfrowHeight()
public
rowHeight(int $rowHeight) : static
Parameters
- $rowHeight : int
Return values
staticsearchFormPlacement()
public
searchFormPlacement([string $location = 'top' ]) : $this
Parameters
- $location : string = 'top'
Return values
$thissetAttribute()
public
setAttribute(string $name, mixed $value) : $this
Parameters
- $name : string
- $value : mixed
Return values
$thissetDataSource()
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
$thissetDefaultDataSource()
public
setDefaultDataSource() : mixed
setRowsPerPage()
public
setRowsPerPage(int $rowsPerPage[, array<string|int, mixed> $options = [] ]) : $this
Parameters
- $rowsPerPage : int
- $options : array<string|int, mixed> = []
Return values
$thissetSearchForm()
public
setSearchForm(AbstractForm|null $searchForm) : void
Parameters
- $searchForm : AbstractForm|null
sortable()
public
sortable([bool $value = true ]) : $this
Parameters
- $value : bool = true
Return values
$thistitle()
public
title(string $title) : GridConfig
Parameters
- $title : string
Return values
GridConfigtoArray()
public
toArray(Request $request) : array<string, mixed>
Parameters
- $request : Request
Return values
array<string, mixed>useAdminSearchForm()
public
useAdminSearchForm() : $this
Return values
$thiswithActions()
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
addColumn()
Add new column by field.
protected
addColumn(string $field) : GridColumn
Parameters
- $field : string
Return values
GridColumninitialize()
protected
initialize() : void