FloatingActionsWidget
extends CWidget
in package
A floating action bar widget for CLSGridView grids.
Renders a persistent floating bar that appears at the bottom of the viewport whenever one or more grid rows are selected (including across pagination).
Action definitions are supplied via the $aActions property and should be maintained in a separate config file (e.g. floating_actions/_actions.php) that returns a PHP array.
Supported action types: 'action' – a single button (direct action or modal) 'dropdown' – a split button with sub-items (each sub-item is an action) 'separator' – a thin vertical divider line
Usage example: $actions = require(DIR . '/floating_actions/_actions.php'); $this->widget('ext.admin.grid.FloatingActionsWidget.FloatingActionsWidget', [ 'pk' => 'sid', 'gridId' => 'survey-grid', 'aActions' => $actions, ]);
Table of Contents
Constants
- MASSIVE_MODALS_DIR = __DIR__ . '/../MassiveActionsWidget/views/modals/'
- Absolute path to the MassiveActionsWidget modals directory
- MODAL_VIEW_NAMES = ['yes-no', 'empty', 'yes-no-lg', 'empty-lg', 'cancel-apply', 'cancel-change', 'cancel-resend', 'cancel-add', 'cancel-save', 'cancel-delete', 'cancel-export']
- Modal view names available in MassiveActionsWidget/views/modals/
Properties
Methods
- getModalId() : string
- Build a unique modal DOM ID for the given action key and action name.
- run() : void
- renderAllModals() : void
- Walk through $aActions and render a modal for every modal-type entry, including sub-items inside 'dropdown' action groups.
- renderModal() : void
- Render a single modal view for one action.
Constants
MASSIVE_MODALS_DIR
Absolute path to the MassiveActionsWidget modals directory
private
mixed
MASSIVE_MODALS_DIR
= __DIR__ . '/../MassiveActionsWidget/views/modals/'
MODAL_VIEW_NAMES
Modal view names available in MassiveActionsWidget/views/modals/
private
mixed
MODAL_VIEW_NAMES
= ['yes-no', 'empty', 'yes-no-lg', 'empty-lg', 'cancel-apply', 'cancel-change', 'cancel-resend', 'cancel-add', 'cancel-save', 'cancel-delete', 'cancel-export']
Properties
$aActions
public
array<string|int, mixed>
$aActions
= []
Action definitions – see class docblock for structure
$gridId
public
string
$gridId
ID attribute of the CLSGridView container element
$pk
public
string
$pk
Primary key column name (e.g. 'sid', 'id')
Methods
getModalId()
Build a unique modal DOM ID for the given action key and action name.
public
getModalId(string $keyStr, string $action) : string
Parameters
- $keyStr : string
-
Key string (numeric index or 'd{n}_{m}' for dropdowns)
- $action : string
-
Action identifier (e.g. 'delete', 'updateTheme')
Return values
stringrun()
public
run() : void
renderAllModals()
Walk through $aActions and render a modal for every modal-type entry, including sub-items inside 'dropdown' action groups.
private
renderAllModals() : void
renderModal()
Render a single modal view for one action.
private
renderModal(string $keyStr, array<string|int, mixed> $action) : void
Parameters
- $keyStr : string
-
Unique string key used to build the modal DOM ID
- $action : array<string|int, mixed>
-
Action definition array