extends |
JsCallback |
|---|---|
implements |
ExecutorInterface |
uses |
HookTrait |
Javascript Action executor.
Will execute a model action using a JS Event.
Usage: When use with View::on method, then JsCallbackExecutor executor is automatically create. $button->on('click', $model->getUserAction('delete'), [4, 'confirm' => 'This will delete record with ID 4. Are you sure?']);
Manual setup. $action = $model->getUserAction('delete') $ex = JsCallbackExecutor::addTo($app)->setAction($action, [4]) $button->on('click', $ex, ['confirm' => 'This will delete record with id 4. Are you sure?']);
| Methods | ||
|---|---|---|
public
|
getAction(): UserAction
|
# |
public
|
setAction(UserAction $action)
|
# |
protected
|
invokeFxWithUrlArgs<T>(Closure(): T $fx, array<string, string> $urlArgs = []): T
|
# |
public
|
jsExecute(array<string, string> $urlArgs = []): JsBlock
|
# |
public
|
executeModelAction(): void
|
# |
| Methods inherited from Atk4\Ui\JsCallback |
|---|
setConfirm(), set(), terminateAjax(), getAjaxec(), getUrl(), |
| Methods inherited from Atk4\Ui\Callback |
|---|
add(), init(), setUrlTrigger(), getUrlTrigger(), terminateJson(), isTriggered(), getTriggeredValue(), canTerminate(), canTrigger(), getJsUrl(), |
| Methods inherited from Atk4\Ui\AbstractView |
|---|
getOwner() |
| Methods used from Atk4\Core\AppScopeTrait |
|---|
assertInstanceOfApp(), issetApp(), getApp(), setApp() |
| Methods used from Atk4\Core\ContainerTrait |
|---|
_uniqueElementName(), _addContainer(), removeElement(), _shorten(), getElement(), hasElement() |
| Methods used from Atk4\Core\InitializerTrait |
|---|
isInitialized(), assertIsInitialized(), invokeInit() |
| Methods used from Atk4\Core\StaticAddToTrait |
|---|
_addToAdd(), addTo(), addToWithCl(), addToWithClUnsafe() |
| Methods used from Atk4\Core\TrackableTrait |
|---|
issetOwner(), setOwner(), unsetOwner(), getDesiredName(), destroy() |
| Constants inherited from Atk4\Ui\Callback |
|---|
|
| Properties | |||
|---|---|---|---|
public
|
UserAction
|
$action
|
# |
public
|
JsExpressionable|Closure
|
$jsSuccess
|
# |
| Properties inherited from Atk4\Ui\JsCallback |
|---|
$args, $confirm, $apiConfig, $storeName, $triggerOnReload |
| Properties inherited from Atk4\Ui\Callback |
|---|
$urlTrigger, |
| Properties inherited from Atk4\Ui\AbstractView |
|---|
$_addLater, $_rendered, $elements |
| Properties used from Atk4\Core\AppScopeTrait |
|---|
$_app, $maxNameLength, $uniqueNameHashes |
| Properties used from Atk4\Core\ContainerTrait |
|---|
$_elementNameCounts |
| Properties used from Atk4\Core\InitializerTrait |
|---|
$_initialized |
| Properties used from Atk4\Core\NameTrait |
|---|
$name |
| Properties used from Atk4\Core\TrackableTrait |
|---|
$_owner, $shortName |
| Properties used from Atk4\Core\HookTrait |
|---|
$hooks, $_hookIndexCounter, $_hookOrigThis |