Actions:
Wonderful Relations Actions are our default way to register ajax functions. So the client calls an standardized ,… and it gets a callback
Callback Types:
- MODAL
- STRING
- TEMPLATE
- FILE
- JSON (Default)
- SCRIPT
Minimal Implementation:
class YourClassName implements ActionTypeCallback {
public function __construct() {
new ActionType( "return_text", $this, Constants::CALLBACK_TYPE_MODAL );
}
public function execute_callback(): string {
return "TEXT";
}
}
Example Action Callback: Reload DataTable
return array(
Constants::CALLBACK_TYPE_SCRIPT,
"jQuery('#{$this->payload["datatable_identifier"]}').DataTable().ajax.reload()"
);