| Methods |
protected
|
init(): void
Called when view becomes part of render tree. You can override it but avoid
placing any "heavy processing" here.
Called when view becomes part of render tree. You can override it but avoid
placing any "heavy processing" here.
Overrides
Overriden by
|
#
|
protected
|
initTable(): Table
|
#
|
public
|
addColumn(
string|null $name,
array|Column $columnDecorator = [],
($name is null ? array{} : array|Field) $field = [],
): Column
Add new column to grid. If column with this name already exists,
an. Simply calls Table::addColumn(), so check that…
Add new column to grid. If column with this name already exists,
an. Simply calls Table::addColumn(), so check that method out.
Parameters
| $name |
Data model field name
|
|
#
|
public
|
addDecorator(string $name, array|Column $seed): Column
Add additional decorator for existing column.
Add additional decorator for existing column.
|
#
|
public
|
addButton(string $label): Button
Add a new button to the Grid Menu with a given text.
Add a new button to the Grid Menu with a given text.
|
#
|
public
|
setIpp(int|list<int> $ipp, string $label = 'Items per page:'): void
Set item per page value.
Set item per page value.
If an array is passed, it will also add an ItemPerPageSelector to paginator.
|
#
|
public
|
addItemsPerPageSelector(list<int> $items = [10, 100, 1000], string $label = 'Items per page:'): $this
Add ItemsPerPageSelector View in grid menu or paginator in order to dynamically setup number of item per page.
Add ItemsPerPageSelector View in grid menu or paginator in order to dynamically setup number of item per page.
Parameters
| $items |
an array of item's per page value
|
| $label |
the memu item label
|
|
#
|
public
|
addJsPaginator(int $ipp, array $options = [], View $container = null, string $scrollRegion = 'Body'): $this
Add dynamic scrolling paginator.
Add dynamic scrolling paginator.
Parameters
| $ipp |
number of item per page to start with
|
| $options |
an array with JS Scroll plugin options
|
| $container |
the container holding the lister for scrolling purpose
|
| $scrollRegion |
A specific template region to render. Render output is append to container HTML element.
|
|
#
|
public
|
addJsPaginatorInContainer(
int $ipp,
int $containerHeight,
array $options = [],
View $container = null,
string $scrollRegion = 'Body',
): $this
Add dynamic scrolling paginator in container.
Use this to make table headers fixed.
Add dynamic scrolling paginator in container.
Use this to make table headers fixed.
Parameters
| $ipp |
number of item per page to start with
|
| $containerHeight |
number of pixel the table container should be
|
| $options |
an array with JS Scroll plugin options
|
| $container |
the container holding the lister for scrolling purpose
|
| $scrollRegion |
A specific template region to render. Render output is append to container HTML element.
|
|
#
|
public
|
addQuickSearch(array $fields = [], bool $hasAutoQuery = false): void
Add Search input field using JS action.
By default, will query server when using Enter key on input search field.
You…
Add Search input field using JS action.
By default, will query server when using Enter key on input search field.
You can change it to query server on each keystroke by passing $autoQuery true,.
Parameters
| $fields |
the list of fields to search for
|
| $hasAutoQuery |
will query server on each key pressed
|
|
#
|
public
|
jsReload($args = [], $afterSuccess = null, $apiConfig = []): JsExpressionable
Returns JS for reloading View.
Returns JS for reloading View.
Overrides
|
#
|
public
|
addActionButton(
string|array|View $button,
JsExpressionable|JsCallbackSetClosure $action = null,
string $confirmMsg = '',
bool $isDisabled = false,
): View
Adds a new button into the action column on the right. For Crud this
column will already contain "delete" and "edit"…
Adds a new button into the action column on the right. For Crud this
column will already contain "delete" and "edit" buttons.
Parameters
| $button |
Label text, object or seed for the Button
|
|
#
|
public
|
addExecutorButton(ExecutorInterface $executor, Button $button = null): View
Add a button for executing a model action via an action executor.
Add a button for executing a model action via an action executor.
|
#
|
private
|
getActionButtons(): ActionButtons
|
#
|
public
|
addActionMenuItem(
View|string $view,
JsExpressionable|JsCallbackSetClosure $action = null,
string $confirmMsg = '',
bool $isDisabled = false,
): View
Similar to addActionButton. Will add Button that when click will display
a Dropdown menu.
Similar to addActionButton. Will add Button that when click will display
a Dropdown menu.
|
#
|
public
|
addExecutorMenuItem(ExecutorInterface $executor): View
|
#
|
private
|
getActionMenu(): ActionMenu
|
#
|
public
|
addActionMenuFromModel(string|null $appliesTo = null): void
Add action menu items using Model.
You may specify the scope of actions to be added.
Add action menu items using Model.
You may specify the scope of actions to be added.
Parameters
| $appliesTo |
the scope of model action
|
|
#
|
public
|
addFilterColumn(array|null $names = null): $this
An array of column name where filter is needed.
Leave empty to include all column in grid.
An array of column name where filter is needed.
Leave empty to include all column in grid.
Parameters
| $names |
an array with the name of column
|
|
#
|
public
|
addDropdown(
string $columnName,
array $items,
Closure(string): (JsExpressionable|View|string|void) $fx,
string $icon = 'caret square down',
string $menuId = null,
): void
Add a dropdown menu to header column.
Add a dropdown menu to header column.
Parameters
| $columnName |
the name of column where to add dropdown
|
| $items |
the menu items to add
|
| $fx |
the callback function to execute when an item is selected
|
| $icon |
the icon
|
| $menuId |
the menu ID return by callback
|
|
#
|
public
|
addPopup(string $columnName, Popup $popup = null, string $icon = 'caret square down'): mixed
Add a popup to header column.
Add a popup to header column.
Parameters
| $columnName |
the name of column where to add popup
|
| $popup |
popup view
|
| $icon |
the icon
|
|
#
|
public
|
addModalAction(
string|array|View $button,
string $title,
Closure(View, string|null): void $callback,
array $args = [],
): View
Similar to addActionButton but when button is clicked, modal is displayed
with the $title and $callback is executed.
Similar to addActionButton but when button is clicked, modal is displayed
with the $title and $callback is executed.
Parameters
| $args |
extra URL argument for callback
|
|
#
|
private
|
explodeSelectionValue(string $value): list<string>
|
#
|
public
|
addBulkAction(
string|array|MenuItem $item,
Closure(Jquery, list<string>): JsExpressionable $callback,
array $args = [],
): View
Similar to addActionButton but apply to a multiple records selection and display in menu.
When menu item is clicked, …
Similar to addActionButton but apply to a multiple records selection and display in menu.
When menu item is clicked, $callback is executed.
Parameters
| $args |
extra URL argument for callback
|
|
#
|
public
|
addModalBulkAction(
string|array|MenuItem $item,
string $title,
Closure(View, list<string>): void $callback,
array $args = [],
): View
Similar to addModalAction but apply to a multiple records selection and display in menu.
When menu item is clicked,…
Similar to addModalAction but apply to a multiple records selection and display in menu.
When menu item is clicked, modal is displayed with the $title and $callback is executed.
Parameters
| $args |
extra URL argument for callback
|
|
#
|
public
|
getSortBy(): ?string
Get sortBy value from URL parameter.
Get sortBy value from URL parameter.
|
#
|
public
|
applySort(): void
Apply ordering to the current model as per the sort parameters.
Apply ordering to the current model as per the sort parameters.
Overriden by
|
#
|
public
|
setModel(Model $model, array<int, string>|null $fields = null): void
Associate this view with a model. Do not place any logic in this class, instead take it
to renderView().
Associate this view with a model. Do not place any logic in this class, instead take it
to renderView().
Do not try to create your own "Model" implementation, instead you must be looking for
your own "Persistence" implementation.
Parameters
| $fields |
if null, then all "editable" fields will be added
|
Overrides
Overriden by
|
#
|
public
|
addSelection(): Checkbox
Makes rows of this grid selectable by creating new column on the left with
checkboxes.
Makes rows of this grid selectable by creating new column on the left with
checkboxes.
|
#
|
public
|
addDragHandler(): Column
Add column with drag handler on each row.
Drag handler allow to reorder table via drag and drop.
Add column with drag handler on each row.
Drag handler allow to reorder table via drag and drop.
|
#
|
private
|
setModelLimitFromPaginator(): void
|
#
|
protected
|
renderView(): void
View-specific rendering stuff. Feel free to replace this method with
your own. View::renderView contains some logic…
View-specific rendering stuff. Feel free to replace this method with
your own. View::renderView contains some logic that integrates with
Fomantic-UI.
Overrides
|
#
|
protected
|
recursiveRender(): void
Recursively render all children, placing their output in our template.
Recursively render all children, placing their output in our template.
Overrides
|
#
|
public
|
jsRow(): Jquery
Proxy function for Table::jsRow().
Proxy function for Table::jsRow().
|
#
|