| 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
|
#
|
protected
|
addMenuBarSearch(): void
|
#
|
protected
|
addPaginator(): void
|
#
|
public
|
setModel(Model $model, array<int, string>|null $fields = null, array $extra = 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.
Overrides
|
#
|
protected
|
setItemsAction(): void
Setup JS for firing menu action - copied from Crud - TODO deduplicate.
Setup JS for firing menu action - copied from Crud - TODO deduplicate.
|
#
|
protected
|
initActionExecutor(UserAction $action): ExecutorInterface
Setup executor for an action.
First determine what fields action needs,
then setup executor based on action fields,…
Setup executor for an action.
First determine what fields action needs,
then setup executor based on action fields, args and/or preview.
Single record scope action use jsSuccess instead of afterExecute hook
because hook will keep adding for every cards, thus repeating jsExecute multiple time,
i.e. once for each card, unless hook is break.
|
#
|
protected
|
jsExecute(string|JsExpressionable|Model|null $return, UserAction $action): JsBlock
Return proper JS statement for afterExecute hook on action executor
depending on return type, model loaded and action…
Return proper JS statement for afterExecute hook on action executor
depending on return type, model loaded and action scope.
|
#
|
protected
|
jsCreateNotifier(UserAction $action, string $msg = null): JsBlock
Override this method for setting notifier based on action or model value.
Override this method for setting notifier based on action or model value.
|
#
|
private
|
getReloadArgs(): mixed
Return reload argument based on Deck condition.
Return reload argument based on Deck condition.
|
#
|
private
|
getModelActions(string $appliesTo): array
Return proper action need to setup menu or action column.
Return proper action need to setup menu or action column.
|
#
|
protected
|
initPaginator(): int
Will set model limit according to paginator value.
Will set model limit according to paginator value.
|
#
|
| Properties |
public
|
|
$ui = 'basic segment atk-card-deck'
|
#
|
public
|
|
$defaultTemplate = 'card-deck.html'
|
#
|
public
|
class-string<View>
|
$card = Card::class
Card type inside this deck.
Card type inside this deck.
|
#
|
public
|
bool
|
$useTable = false
Whether card should use table display or not.
Whether card should use table display or not.
|
#
|
public
|
bool
|
$useLabel = false
Whether card should use label display or not.
Whether card should use label display or not.
|
#
|
public
|
string|null
|
$extraGlue = ' - '
If using extra field in Card, glue, join them using extra glue.
If using extra field in Card, glue, join them using extra glue.
|
#
|
public
|
bool
|
$useAction = true
If each card should use action or not.
If each card should use action or not.
|
#
|
public
|
SharedExecutorsContainer|null
|
$sharedExecutorsContainer = [SharedExecutorsContainer::class]
|
#
|
public
|
View|null
|
$container = [View::class, 'ui' => 'vertical segment']
The container view. The view that is reload when page or data changed.
The container view. The view that is reload when page or data changed.
|
#
|
public
|
View
|
$cardHolder = [View::class, 'ui' => 'cards']
The view containing Cards.
The view containing Cards.
|
#
|
public
|
Paginator|false|null
|
$paginator = [Paginator::class]
The paginator view.
|
#
|
public
|
int
|
$ipp = 9
The number of cards to be displayed per page.
The number of cards to be displayed per page.
|
#
|
public
|
Menu|array|false
|
$menu
Will be initialized to Menu object, however you can set this to false to disable menu.
Will be initialized to Menu object, however you can set this to false to disable menu.
|
#
|
public
|
array|ItemSearch|false
|
$search = [ItemSearch::class]
|
#
|
public
|
array
|
$notifyDefault = [JsToast::class]
Default notifier to perform when model action is successful *
Default notifier to perform when model action is successful *
|
#
|
public
|
array
|
$singleScopeActions = []
Model single scope action to include in table action column. Will include all single scope actions if empty.
Model single scope action to include in table action column. Will include all single scope actions if empty.
|
#
|
public
|
array
|
$noRecordScopeActions = []
Model no_record scope action to include in menu. Will include all no record scope actions if empty.
Model no_record scope action to include in menu. Will include all no record scope actions if empty.
|
#
|
public
|
string
|
$saveMsg = 'Record has been saved!'
Message to display when record is add or edit successfully.
Message to display when record is add or edit successfully.
|
#
|
public
|
string
|
$deleteMsg = 'Record has been deleted!'
Message to display when record is delete successfully.
Message to display when record is delete successfully.
|
#
|
public
|
string
|
$defaultMsg = 'Done!'
Generic display message for no record scope action where model is not loaded.
Generic display message for no record scope action where model is not loaded.
|
#
|
public
|
array
|
$noRecordDisplay = [
Message::class,
'content' => 'Result empty!',
'icon' => 'info circle',
'text' => 'Your search did not return any record or there is no record available.',
]
seed to create View for displaying when search result is empty.
seed to create View for displaying when search result is empty.
|
#
|
private
|
array
|
$menuActions = []
A collection of menu button added in Menu.
A collection of menu button added in Menu.
|
#
|
private
|
string|null
|
$query
The current search query string.
The current search query string.
|
#
|