Grid
class Grid
Traits
Layui 的参数定义
Trait HasQuickSearch.
Properties
protected string | $name | Grid name. |
from HasElementNames |
protected array | $elementNames | HTML element names. |
from HasElementNames |
protected string | $exporter | Export driver. |
from HasExport |
protected Filter | $filter | from HasFilter | |
static string | $searchKey | from HasQuickSearch | |
protected array|string|Closure | $search | from HasQuickSearch | |
protected Collection | $columns | Collection of all grid columns. |
|
Tools | $tools | from HasQuickSearch | |
protected array | $totalRowColumns | from HasTotalRow | |
protected Closure | $actionsCallback | Callback for grid actions. |
from HasActions |
protected string | $actionsClass | Actions column display class. |
from HasActions |
protected array | $batchActions | from HasActions | |
protected Selector | $selector | from HasSelector | |
$hiddenColumns | Default columns be hidden. |
from CanHidesColumns | |
protected array | $layElem | from LayDefines | |
protected | $layCols | from LayDefines | |
protected int | $layCellMinWidth | 全局定义常规单元格的最小宽度,layui 2.2.1 新增 |
from LayDefines |
protected | $layPage | from LayDefines | |
protected | $quickButtons | from HasQuickButton | |
array | $columnNames | All column names of the grid. |
|
array | $perPages | Per-page options. |
|
int | $perPage | 默认分页数 | |
string | $tableId | ||
protected LengthAwarePaginator | $paginator | ||
protected Model | $model | The grid data model instance. |
|
protected Collection | $rows | Collection of all data rows. |
|
protected Closure | $rowsCallback | Rows callable function. |
|
protected Closure | $builder | Grid builder. |
|
protected bool | $isBuild | Mark if the grid is builded. |
|
protected array | $variables | All variables in grid view. |
|
protected string | $keyName | Default primary key name. |
|
protected string | $view | View for grid to render. |
|
protected | $renderingCallbacks | ||
protected array | $options | Options for grid. |
|
static protected | $initCallbacks | Initialization closure array. |
Methods
Add where like binding to model query.
Add where date time function binding to model query.
Add where in binding to the model query.
Add where between binding to the model query.
Add where basic binding to the model query.
Remove column selector on grid.
Setting default shown columns on grid.
No description
Get or set option for grid.
Get primary key name of model.
Paginate the grid.
Get the grid paginator.
设置分页的可选条目数
Disable row selector.
Build the grid.
Get current resource url.
Set a view to render.
Get the string contents of the grid view.
No description
No description
Initialize.
Call the initialization closure array in sequence.
添加多选框列
Apply column filter to grid query.
Apply column search to grid query.
No description
添加多选 / 操作项目
Build the grid rows.
Get all variables will used in grid view.
Call callbacks before render.
Details
in
HasElementNames at line 35
$this
setName(string $name)
Set name to grid.
in
HasElementNames at line 51
string
getName()
Get name of grid.
in
HasElementNames at line 59
string
getGridRowName()
No description
in
HasElementNames at line 67
string
getSelectAllName()
No description
in
HasElementNames at line 75
string
getPerPageName()
No description
in
HasElementNames at line 83
string
getGridBatchName()
No description
in
HasElementNames at line 91
string
getExportSelectedName()
No description
in
HasElementNames at line 99
string
getSelectedRowsName()
No description
in
HasElementNames at line 113
protected string
elementNameWithPrefix($name)
No description
in
HasExport at line 23
bool
isShowExporter()
是否显示导出按钮
in
HasExport at line 44
string
renderExportButton()
Render export button.
in
HasExport at line 72
string
getExportUrl(int $scope = 1, null $args = null)
Get the export url.
in
HasExport at line 88
protected
handleExportRequest(bool $forceExport = false)
Handle export request.
in
HasExport at line 111
protected AbstractExporter
getExporter(string $scope)
No description
in
HasFilter at line 37
array|Collection|mixed
applyFilter(bool $toArray = true)
执行查询器
in
HasFilter at line 57
Factory|View|string
renderFilter()
Render the grid filter.
in
HasFilter at line 67
protected $this
initFilter()
初始化筛选
in
HasQuickSearch at line 35
QuickSearch
quickSearch($search = null)
No description
in
HasQuickSearch at line 54
protected mixed|void
applyQuickSearch()
Apply the search query to the query.
in
HasQuickSearch at line 83
protected
addWhereBindings(string $query)
Add where bindings.
in
HasQuickSearch at line 127
protected array
parseQueryBindings(array $queries)
Parse quick query bindings.
in
HasQuickSearch at line 165
protected
addWhereLikeBinding(string $column, bool $or, string $pattern)
Add where like binding to model query.
in
HasQuickSearch at line 183
protected
addWhereDatetimeBinding(string $column, bool $or, string $function, string $value)
Add where date time function binding to model query.
in
HasQuickSearch at line 198
protected
addWhereInBinding(string $column, bool $or, bool $not, string $values)
Add where in binding to the model query.
in
HasQuickSearch at line 223
protected
addWhereBetweenBinding(string $column, bool $or, string $start, string $end)
Add where between binding to the model query.
in
HasQuickSearch at line 238
protected
addWhereBasicBinding(string $column, bool $or, string $operator, string $value)
Add where basic binding to the model query.
in
HasTools at line 37
string
renderHeaderTools()
Render custom tools.
in
HasTotalRow at line 23
$this
addTotalRow(string $column, Closure $callback)
No description
in
HasTotalRow at line 33
Factory|View|string
renderTotalRow($columns = null)
No description
in
HasActions at line 37
$this
actions(Closure|string $actions)
Set grid action callback.
in
HasActions at line 51
string
getActionClass()
Get action display class.
in
HasActions at line 65
$this
setActionClass(string $actionClass)
No description
in
HasActions at line 80
HasActions
batchActions(array $array)
Set grid batch-action callback.
in
HasActions at line 91
Grid|mixed
disableBatchActions(bool $disable = true)
No description
in
HasActions at line 104
string
renderBatchActions()
Render create button for grid.
in
HasActions at line 118
string
skeletonBatchActions()
Render create button for grid.
in
HasSelector at line 22
$this
selector(Closure $closure)
No description
in
HasSelector at line 40
Factory|View|string
renderSelector()
Render grid selector.
in
HasSelector at line 50
protected $this
applySelectorQuery()
Apply selector query to grid model query.
in
CanHidesColumns at line 26
bool
disableColumnSelector(bool $disable = true)
Remove column selector on grid.
in
CanHidesColumns at line 34
bool
showColumnSelector()
No description
in
CanHidesColumns at line 46
CanHidesColumns
hideColumns(array|string $columns)
Setting default shown columns on grid.
in
CanHidesColumns at line 65
Collection
visibleColumns()
Get all visible column instances.
in
CanHidesColumns at line 85
array
visibleColumnNames()
Get all visible column names.
in
CanHidesColumns at line 105
array
getDefaultVisibleColumnNames()
Get default visible column names.
in
CanHidesColumns at line 121
protected array
getVisibleColumnsFromQuery()
Get visible columns from request query.
in
PoppyTrait at line 41
protected AuthManager
pyAuth()
get auth
in
PoppyTrait at line 50
protected Translator
pyTranslator()
get translator
in
PoppyTrait at line 60
protected Repository
pyConfig()
Get configuration instance.
in
PoppyTrait at line 70
protected DatabaseManager
pyDb()
get db
in
PoppyTrait at line 79
protected Kernel
pyConsole()
Get console instance.
in
PoppyTrait at line 88
protected Container
pyContainer()
Get IoC Container.
in
PoppyTrait at line 97
protected Mailer
pyMailer()
Get mailer instance.
in
PoppyTrait at line 106
protected SessionManager|Store
pySession()
Get session instance.
in
PoppyTrait at line 115
protected Request
pyRequest()
get request
in
PoppyTrait at line 125
protected Redirector
pyRedirector()
get redirector
in
PoppyTrait at line 134
protected Factory
pyValidation()
get validation
in
PoppyTrait at line 144
protected Dispatcher
pyEvent()
get event
in
PoppyTrait at line 154
protected LoggerInterface
pyLogger()
get logger
in
PoppyTrait at line 164
protected ResponseFactory
pyResponse()
get response
in
PoppyTrait at line 174
protected Filesystem
pyFile()
get file
in
PoppyTrait at line 184
protected UrlGenerator
pyUrl()
get url
in
PoppyTrait at line 195
protected mixed
pyCache(string $tag = '')
get cache
in
PoppyTrait at line 209
protected RedisManager
pyRedis()
get redis
in
PoppyTrait at line 218
protected Factory
pyView()
get view
in
PoppyTrait at line 227
protected Poppy
pyPoppy()
get poppy
in
PoppyTrait at line 236
protected Ini
pyIni()
Ini Parser
in
PoppyTrait at line 245
protected Xml
pyXml()
Ini Parser
in
PoppyTrait at line 254
protected Yaml
pyYaml()
Yaml Parser
in
LayDefines at line 33
protected
layPrependRowSelectorColumn()
增加行选择器
in
LayDefines at line 42
protected
layFormat()
Layui 格式化
in
LayDefines at line 52
protected
layColumns()
列样式
in
LayDefines at line 84
protected false|string
layDefine()
定义 Layui 的数据定义
in
HasQuickButton at line 17
array
appendQuickButton(array $buttons)
Get create url.
in
HasQuickButton at line 33
string
renderQuickButton()
Render create button for grid.
in
HasQuickButton at line 42
array
skeletonQuickButton()
No description
at line 158
__construct(Model $model, Closure $builder = null)
Create a new grid instance.
at line 176
Model
model()
Get Grid model.
at line 187
setLists(string $grid_class, string $field = '', string $order = 'desc')
No description
at line 227
$this|mixed
option(string $key, mixed $value = null)
Get or set option for grid.
at line 243
string
getKeyName()
Get primary key name of model.
at line 255
void
paginate(int $perPage = 15)
Paginate the grid.
at line 267
mixed
paginator()
Get the grid paginator.
at line 282
perPages(array $perPages)
设置分页的可选条目数
at line 293
Grid
disableRowSelector(bool $disable = true)
Disable row selector.
at line 303
void
build()
Build the grid.
at line 319
rows(Closure $callable = null)
Set grid row callback function.
at line 328
string
resource()
Get current resource url.
at line 340
Grid
with(array $variables = [])
Add variables to grid view.
at line 353
setView(string $view, array $variables = [])
Set a view to render.
at line 369
Grid
setTitle(string $title)
Set grid title.
at line 383
Grid
rendering(callable $callback)
Set rendering callback.
at line 396
string
render()
Get the string contents of the grid view.
at line 423
int
getPerPage()
No description
at line 428
skeleton()
No description
at line 473
static
init(Closure $callback = null)
Initialize with user pre-defined default disables and exporter, etc.
at line 481
protected
initialize()
Initialize.
at line 495
protected
callInitCallbacks()
Call the initialization closure array in sequence.
at line 511
protected void
prependRowSelectorColumn()
添加多选框列
at line 525
protected void
applyColumnFilter()
Apply column filter to grid query.
at line 537
protected void
applyColumnSearch()
Apply column search to grid query.
at line 547
protected array|Collection|mixed
applyQuery()
No description
at line 564
protected void
addDefaultColumns()
添加多选 / 操作项目
at line 576
protected void
buildRows(array $data)
Build the grid rows.
at line 592
protected array
variables()
Get all variables will used in grid view.
at line 610
protected void
callRenderingCallback()
Call callbacks before render.