Class kartik\dynagrid\DynaGrid

Inheritancekartik\dynagrid\DynaGrid » kartik\base\Widget » yii\base\Widget » yii\base\Component » yii\base\BaseObject
Implementskartik\base\BootstrapInterface, yii\base\Configurable, yii\base\ViewContextInterface
Uses Traitskartik\base\BootstrapTrait, kartik\base\TranslationTrait, kartik\base\WidgetTrait, kartik\dynagrid\DynaGridTrait
Available since version1.0

Enhance GridView by allowing you to dynamically edit grid configuration. The dynagrid allows you to set your own grid theme, pagesize, and column order/display settings. The widget allows you to manage the order and visibility of columns dynamically at runtime. It also allows you to save this configuration or retrieve the saved configuration to/from session, cookie, or database.

Public Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
$allowFilterSetting boolean Whether to allow display/setup of the filter in the personalize grid form kartik\dynagrid\DynaGrid
$allowPageSetting boolean Whether to allow setup of the pagination. kartik\dynagrid\DynaGrid
$allowSortSetting boolean Whether to allow display/setup of the sort in the personalize grid form kartik\dynagrid\DynaGrid
$allowThemeSetting boolean Whether to allow display/setup of the theme. kartik\dynagrid\DynaGrid
$autoIdPrefix string The prefix to the automatically generated widget IDs. yii\base\Widget
$baseSourcePath string|false Get parsed base source path based on $sourcePath setting. If $sourcePath is not set, it will return the current working directory of this widget class. kartik\base\WidgetTrait
$behaviors yii\base\Behavior[] List of behaviors attached to this component. yii\base\Component
$bsColCssPrefixes array The bootstrap grid column css prefixes mapping, the key is the bootstrap versions, and the value is an array containing the sizes and their corresponding grid column css prefixes. kartik\base\BootstrapTrait
$bsCssMap array CSS conversion mappings across bootstrap library versions. kartik\base\BootstrapTrait
$bsExtBasename integer The yii2 bootstrap extension base name (readonly property available via getter method getBsExtBasename()) kartik\base\BootstrapTrait
$bsVer integer Bootstrap version number currently set (readonly property available via getter method getBsVer()) kartik\base\BootstrapTrait
$bsVersion integer|string The bootstrap library version that you wish to use for this specific extension / widget. kartik\base\BootstrapTrait
$columns array The grid columns configuration kartik\dynagrid\DynaGrid
$counter integer A counter used to generate $id for widgets. yii\base\Widget
$dbUpdateNameOnly boolean Whether to update only the name, when editing and saving a filter or sort. kartik\dynagrid\DynaGrid
$defaultBtnCss string Default bootstrap button CSS (readonly property available via getter method getDefaultBtnCss()) kartik\base\BootstrapTrait
$defaultIconPrefix string Default icon prefix (readonly property available via getter method getDefaultIconPrefix()) kartik\base\BootstrapTrait
$defaultOptions array Default HTML attributes or other settings for widgets. kartik\base\WidgetTrait
$defaultPluginOptions array Default plugin options for the widget kartik\base\WidgetTrait
$deleteButtonOptions array|boolean The HTML attributes for the delete/trash action button. kartik\dynagrid\DynaGrid
$deleteConfirmation string The confirmation warning message before deleting a personalization configuration or setting. kartik\dynagrid\DynaGrid
$deleteMessage string The message to display after deleting the configuration and until refreshed grid is reloaded kartik\dynagrid\DynaGrid
$dropdownClass string Bootstrap dropdown class name based on currently configured bootstrap version (readonly property available via getter method getDropdownClass()) kartik\base\BootstrapTrait
$enableMultiSort boolean Whether to enable multiple sort. kartik\dynagrid\DynaGrid
$gridOptions array Widget options for \kartik\widgets\GridView that will be rendered by the DynaGrid widget kartik\dynagrid\DynaGrid
$hashVarLoadPosition integer The position where the client JS hash variables for the input widget will be loaded. kartik\base\WidgetTrait
$i18n array The the internalization configuration for this widget. kartik\base\TranslationTrait
$iconConfirm string The icon for the save button within the dynagrid configuration form. kartik\dynagrid\DynaGrid
$iconFilter string The icon that will be displayed as the label for grid filter personalization button. kartik\dynagrid\DynaGrid
$iconHiddenColumn string The icon that will be displayed for each HIDDEN column heading in the column reordering pane. kartik\dynagrid\DynaGrid
$iconPersonalize string The icon that will be displayed on the dynagrid personalize button as well as the personalize modal dialog header. kartik\dynagrid\DynaGrid
$iconRemove string The icon for the save button within the dynagrid configuration form. kartik\dynagrid\DynaGrid
$iconSort string The icon that will be displayed as the label for grid sort personalization button. kartik\dynagrid\DynaGrid
$iconSortableSeparator string The icon that will be displayed separating the visible and hidden columns in the column reordering pane. kartik\dynagrid\DynaGrid
$iconVisibleColumn string The icon that will be displayed for each VISIBLE column heading in the column reordering pane. kartik\dynagrid\DynaGrid
$id string|null ID of the widget. Note that the type of this property differs in getter and setter. See getId() and setId() for details. yii\base\Widget
$krajeeDialogSettings array Configuration settings for the Krajee dialog widget that will be used to render alerts and confirmation dialog prompts kartik\dynagrid\DynaGrid
$matchPanelStyle boolean Whether the DynaGrid configuration button class should match the grid panel style. kartik\dynagrid\DynaGrid
$messageOptions array HTML attributes for the submission message container kartik\dynagrid\DynaGrid
$moduleId string The module identifier if this widget is part of a module. kartik\dynagrid\DynaGrid
$options array HTML options for the DynaGrid widget kartik\dynagrid\DynaGrid
$pjaxContainerId string The identifier for the PJAX widget container if the widget is to be rendered inside a PJAX container. kartik\base\WidgetTrait
$pjaxDuplicationFix boolean Prevent duplication of pjax containers when browser back & forward buttons are pressed. kartik\base\WidgetTrait
$pluginDestroyJs string The javascript that will be used to destroy the jQuery plugin kartik\base\WidgetTrait
$pluginEvents array Widget JQuery events. kartik\base\WidgetTrait
$pluginName string The plugin name kartik\base\WidgetTrait
$pluginOptions array Widget plugin options. kartik\base\WidgetTrait
$resetButtonOptions array|boolean The HTML attributes for the reset action button. kartik\dynagrid\DynaGrid
$showFilter boolean Whether to show the filter save widget button. kartik\dynagrid\DynaGrid
$showPersonalize boolean Whether to show the personalize button group. kartik\dynagrid\DynaGrid
$showSort boolean Whether to show the sort save widget button. kartik\dynagrid\DynaGrid
$sortableHeader array The HTML attributes for the sortable columns header kartik\dynagrid\DynaGrid
$sortableOptions array The sortable widget options kartik\dynagrid\DynaGrid
$sourcePath string Directory path to the original widget source. kartik\base\WidgetTrait
$stack yii\base\Widget[] The widgets that are currently being rendered (not ended). yii\base\Widget
$storage string The type of storage for the dynagrid configuration. kartik\dynagrid\DynaGrid
$submitButtonOptions array The HTML attributes for the save/apply action button. kartik\dynagrid\DynaGrid
$submitMessage string The message to display after applying and submitting the configuration and until refreshed grid is reloaded kartik\dynagrid\DynaGrid
$theme string The initial grid theme to be set kartik\dynagrid\DynaGrid
$toggleButtonFilter array The HTML attributes for the filter configuration button which will render the Filter settings form within a Bootstrap Modal container. kartik\dynagrid\DynaGrid
$toggleButtonGrid array The HTML attributes for the dynagrid personalize toggle button which will render the DynaGrid configuration form within a Bootstrap Modal container. kartik\dynagrid\DynaGrid
$toggleButtonSort array The HTML attributes for the sort configuration button which will render the Sort settings form within a Bootstrap Modal container. kartik\dynagrid\DynaGrid
$userSpecific boolean Whether settings are stored specific to each user kartik\dynagrid\DynaGrid
$view yii\web\View The view object that can be used to render views or view files. Note that the type of this property differs in getter and setter. See getView() and setView() for details. yii\base\Widget
$viewPath string The directory containing the view files for this widget. yii\base\Widget

Protected Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
$_bsVer integer Current bootstrap version number kartik\base\BootstrapTrait
$_columns array The cached columns configuration kartik\dynagrid\DynaGrid
$_dataVar string The HTML5 data variable name that will be used to store the Json encoded pluginOptions within the element on which the jQuery plugin will be initialized. kartik\base\WidgetTrait
$_defaultBtnCss string Default bootstrap button CSS kartik\base\BootstrapTrait
$_defaultIconPrefix string Default icon CSS prefix kartik\base\BootstrapTrait
$_detailConfig array The dynagrid detail configuration settings (for filter and sort) kartik\dynagrid\DynaGrid
$_encOptions string The JSON encoded plugin options. kartik\base\WidgetTrait
$_filterId integer The grid filter id kartik\dynagrid\DynaGrid
$_filterKey string The unique element identifier for the hidden filter input kartik\dynagrid\DynaGrid
$_filterModalId string The identifier for the filter settings modal dialog kartik\dynagrid\DynaGrid
$_gridModalId string The identifier for the grid settings modal dialog kartik\dynagrid\DynaGrid
$_hashVar string The generated hashed variable name that will store the JSON encoded pluginOptions in yii\web\View::POS_HEAD. kartik\base\WidgetTrait
$_hiddenColumns array The hidden widget columns for user configuration kartik\dynagrid\DynaGrid
$_icons array The configuration for icons set as $key => $setting, where $key is the icon property in DynaGrid widget and the $setting is an array of 2 values - the first value in the array is the icon suffix CSS class for Bootstrap 3. kartik\dynagrid\DynaGrid
$_isBs4 boolean Flag to detect whether bootstrap 4. kartik\base\BootstrapTrait
$_isPjax boolean Flag to check if the pjax is enabled for the grid kartik\dynagrid\DynaGrid
$_isSubmit boolean Flag to check if the grid configuration form has been submitted kartik\dynagrid\DynaGrid
$_model kartik\dynagrid\models\DynaGridConfig Model kartik\dynagrid\DynaGrid
$_module kartik\dynagrid\Module The current module kartik\dynagrid\DynaGrid
$_msgCat string Translation message file category name for i18n. kartik\base\TranslationTrait
$_pageSize integer The grid pagesize kartik\dynagrid\DynaGrid
$_pjaxId string The identifier for pjax container kartik\dynagrid\DynaGrid
$_requestSubmit string Request param name which will show the grid configuration submitted kartik\dynagrid\DynaGrid
$_sortId integer The grid sort id kartik\dynagrid\DynaGrid
$_sortKey string The unique element identifier for the hidden sort input kartik\dynagrid\DynaGrid
$_sortModalId string The identifier for the sort settings modal dialog kartik\dynagrid\DynaGrid
$_store kartik\dynagrid\DynaGridStore The storage instance kartik\dynagrid\DynaGrid
$_visibleColumns array The user configured visible widget columns kartik\dynagrid\DynaGrid
$_visibleKeys array The stored visible keys kartik\dynagrid\DynaGrid

Public Methods

Hide inherited methods

MethodDescriptionDefined By
__call() Calls the named method which is not a class method. yii\base\Component
__clone() This method is called after the object is created by cloning an existing one. yii\base\Component
__construct() Constructor. yii\base\BaseObject
__get() Returns the value of a component property. yii\base\Component
__isset() Checks if a property is set, i.e. defined and not null. yii\base\Component
__set() Sets the value of a component property. yii\base\Component
__unset() Sets a component property to be null. yii\base\Component
addCssClass() Adds bootstrap CSS class to options by parsing the bootstrap version for the specified Bootstrap CSS type. kartik\base\BootstrapTrait
afterRun() This method is invoked right after a widget is executed. yii\base\Widget
attachBehavior() Attaches a behavior to this component. yii\base\Component
attachBehaviors() Attaches a list of behaviors to the component. yii\base\Component
beforeRun() This method is invoked right before the widget is executed. yii\base\Widget
begin() Begins a widget. yii\base\Widget
behaviors() Returns a list of behaviors that this component should behave as. yii\base\Component
canGetProperty() Returns a value indicating whether a property can be read. yii\base\Component
canSetProperty() Returns a value indicating whether a property can be set. yii\base\Component
className() Returns the fully qualified name of this class. yii\base\BaseObject
detachBehavior() Detaches a behavior from the component. yii\base\Component
detachBehaviors() Detaches all behaviors from the component. yii\base\Component
end() Ends a widget. yii\base\Widget
ensureBehaviors() Makes sure that the behaviors declared in behaviors() are attached to this component. yii\base\Component
getBSClass() Gets the respective Bootstrap class based on currently configured bootstrap version. kartik\base\BootstrapTrait
getBaseSourcePath() Get parsed base source path based on $sourcePath setting. If $sourcePath is not set, it will return the current working directory of this widget class. kartik\base\WidgetTrait
getBehavior() Returns the named behavior object. yii\base\Component
getBehaviors() Returns all behaviors attached to this component. yii\base\Component
getBsVer() Gets the current set bootstrap version number. kartik\base\BootstrapTrait
getCat() Gets the category translated description kartik\dynagrid\DynaGridTrait
getColumns() Gets the columns for the dynagrid kartik\dynagrid\DynaGrid
getCssClass() Gets bootstrap css class by parsing the bootstrap version for the specified BS CSS type. kartik\base\BootstrapTrait
getDefaultBtnCss() Gets the default button CSS kartik\base\BootstrapTrait
getDefaultIconPrefix() Gets the default icon css prefix kartik\base\BootstrapTrait
getDropdownClass() Gets the respective bootstrap dropdown class name based on currently configured bootstrap version. kartik\base\BootstrapTrait
getId() Returns the ID of the widget. yii\base\Widget
getView() kartik\base\WidgetTrait
getViewPath() Returns the directory containing the view files for this widget. yii\base\Widget
hasEventHandlers() Returns a value indicating whether there is any handler attached to the named event. yii\base\Component
hasMethod() Returns a value indicating whether a method is defined. yii\base\Component
hasProperty() Returns a value indicating whether a property is defined for this component. yii\base\Component
init() Initializes the object. yii\base\Widget
initI18N() Yii i18n messages configuration for generating translations kartik\base\TranslationTrait
isBs() Validate Bootstrap version kartik\base\BootstrapTrait
isBs4() Validate if Bootstrap 4.x version. kartik\base\BootstrapTrait
off() Detaches an existing event handler from this component. yii\base\Component
on() Attaches an event handler to an event. yii\base\Component
registerWidgetJs() Registers a JS code block for the widget. kartik\base\WidgetTrait
removeCssClass() Removes bootstrap CSS class from options by parsing the bootstrap version for the specified Bootstrap CSS type. kartik\base\BootstrapTrait
render() Renders a view. yii\base\Widget
renderFile() Renders a view file. yii\base\Widget
run() Executes the widget. kartik\dynagrid\DynaGrid
setId() Sets the ID of the widget. yii\base\Widget
setView() Sets the view object to be used by this widget. yii\base\Widget
trigger() Triggers an event. yii\base\Component
widget() Creates a widget instance and runs it. yii\base\Widget

Protected Methods

Hide inherited methods

MethodDescriptionDefined By
addAsset() Adds an asset to the view. kartik\base\WidgetTrait
applyColumns() Applies the configured columns kartik\dynagrid\DynaGrid
applyFilter() Applies the grid filter kartik\dynagrid\DynaGrid
applyGridConfig() Applies the current grid configuration kartik\dynagrid\DynaGrid
applyPageSize() Applies the page size kartik\dynagrid\DynaGrid
applySort() Applies the grid sort kartik\dynagrid\DynaGrid
applyTheme() Applies the configured theme kartik\dynagrid\DynaGrid
canReorder() Can the column be reordered kartik\dynagrid\DynaGrid
configureBsVersion() Configures the bootstrap version settings kartik\base\BootstrapTrait
configureColumns() Reconfigure columns with unique keys kartik\dynagrid\DynaGrid
fixPjaxDuplication() Fix for weird PJAX container duplication behavior on pressing browser back and forward buttons. kartik\base\WidgetTrait
getAttributeLabel() Generates the attribute label kartik\dynagrid\DynaGrid
getBsExtBasename() The yii2-bootstrap extension base name. kartik\base\BootstrapTrait
getColumnKey() Generate an unique column key kartik\dynagrid\DynaGrid
getColumnLabel() Fetches the column label kartik\dynagrid\DynaGrid
getDefaultButtonOptions() Get the default action button option settings kartik\dynagrid\DynaGrid
getGridConfig() Gets the current grid configuration kartik\dynagrid\DynaGrid
getPluginScript() Returns the plugin registration script. kartik\base\WidgetTrait
getSortableHeader() Generates the config for sortable widget header kartik\dynagrid\DynaGrid
hashPluginOptions() Generates a hashed variable to store the pluginOptions. kartik\base\WidgetTrait
initBsVersion() Initializes bootstrap versions for the widgets and asset bundles. kartik\base\BootstrapTrait
initDataProvider() Initialize the data provider kartik\dynagrid\DynaGrid
initDestroyJs() Generates the pluginDestroyJs script if it is not set. kartik\base\WidgetTrait
initGrid() Initialize the grid view for dynagrid kartik\dynagrid\DynaGrid
initIcons() Initializes icon properties with default values kartik\dynagrid\DynaGrid
initModule() Initialize the module based on module identifier kartik\dynagrid\DynaGrid
initWidget() Initializes widget settings and options kartik\dynagrid\DynaGrid
isSameVersion() Compares two versions and checks if they are of the same major BS version. kartik\base\BootstrapTrait
isVisible() Is column visible kartik\dynagrid\DynaGrid
loadAttributes() Load configuration attributes into DynaGridConfig model kartik\dynagrid\DynaGrid
loadGridConfig() Load grid configuration from specific storage kartik\dynagrid\DynaGrid
matchColumnString() Finds the matches for a string column format kartik\dynagrid\DynaGrid
mergeDefaultOptions() Merge default options kartik\base\WidgetTrait
parseData() Parses the encoded grid configuration and fetches - grid master settings: the theme, pagesize, visible keys - grid detail settings: filter and sort configuration kartik\dynagrid\DynaGrid
parseDetailData() Parses the grid detail configuration (for filter or sort). kartik\dynagrid\DynaGrid
parseVer() Parses and returns the major BS version kartik\base\BootstrapTrait
pjaxCleanupJs() Generates the cleanup client script for modals kartik\dynagrid\DynaGrid
prepareColumns() Prepares the columns for the dynagrid kartik\dynagrid\DynaGrid
registerAssets() Registers client assets kartik\dynagrid\DynaGrid
registerPlugin() Registers a specific plugin and the related events kartik\base\WidgetTrait
registerPluginOptions() Registers plugin options by storing within a uniquely generated javascript variable. kartik\base\WidgetTrait
renderActionButton() Renders the action button kartik\dynagrid\DynaGrid
saveGridConfig() Update configuration kartik\dynagrid\DynaGrid
setDataVar() Sets a HTML5 data variable. kartik\base\WidgetTrait
setToggleButton() Sets the personalization toggle button kartik\dynagrid\DynaGrid
setWidgetColumns() Sets widget columns for display in kartik\sortable\Sortable widget kartik\dynagrid\DynaGrid

Events

Hide inherited events

EventTypeDescriptionDefined By
EVENT_AFTER_RUN yii\base\WidgetEvent An event raised right after executing a widget. (available since version 2.0.11) yii\base\Widget
EVENT_BEFORE_RUN yii\base\WidgetEvent An event raised right before executing a widget. (available since version 2.0.11) yii\base\Widget
EVENT_INIT yii\base\Event An event that is triggered when the widget is initialized via init(). (available since version 2.0.11) yii\base\Widget

Constants

Hide inherited constants

ConstantValueDescriptionDefined By
ORDER_FIX_LEFT 'fixleft' kartik\dynagrid\DynaGrid
ORDER_FIX_RIGHT 'fixright' kartik\dynagrid\DynaGrid
ORDER_MIDDLE 'middle' kartik\dynagrid\DynaGrid
TYPE_DB 'db' kartik\dynagrid\DynaGrid
TYPE_SESSION 'session' kartik\dynagrid\DynaGrid

Property Details

$_columns protected property

The cached columns configuration

protected array $_columns = []
$_detailConfig protected property

The dynagrid detail configuration settings (for filter and sort)

protected array $_detailConfig = []
$_filterId protected property

The grid filter id

protected integer $_filterId null
$_filterKey protected property

The unique element identifier for the hidden filter input

protected string $_filterKey null
$_filterModalId protected property

The identifier for the filter settings modal dialog

protected string $_filterModalId null
$_gridModalId protected property

The identifier for the grid settings modal dialog

protected string $_gridModalId null
$_hiddenColumns protected property

The hidden widget columns for user configuration

protected array $_hiddenColumns = []
$_icons protected static property

The configuration for icons set as $key => $setting, where $key is the icon property in DynaGrid widget and the $setting is an array of 2 values - the first value in the array is the icon suffix CSS class for Bootstrap 3.x and the second value in the array is the icon suffix CSS class for Bootstrap 4.x.

protected static array $_icons = [
    'iconVisibleColumn' => ['eye-open''eye'], 'iconHiddenColumn' => ['eye-close''eye-slash'], 'iconSortableSeparator' => ['resize-horizontal''arrows-alt-h'], 'iconPersonalize' => ['wrench''wrench fa-fw'], 'iconFilter' => ['filter''filter fa-fw'], 'iconSort' => ['sort''sort fa-fw'], 'iconConfirm' => ['ok''check'], 'iconRemove' => ['remove''times']
]
$_isPjax protected property

Flag to check if the pjax is enabled for the grid

protected boolean $_isPjax null
$_isSubmit protected property

Flag to check if the grid configuration form has been submitted

protected boolean $_isSubmit false
$_model protected property

Model

$_module protected property

The current module

$_pageSize protected property

The grid pagesize

protected integer $_pageSize null
$_pjaxId protected property

The identifier for pjax container

protected string $_pjaxId null
$_requestSubmit protected property

Request param name which will show the grid configuration submitted

protected string $_requestSubmit null
$_sortId protected property

The grid sort id

protected integer $_sortId null
$_sortKey protected property

The unique element identifier for the hidden sort input

protected string $_sortKey null
$_sortModalId protected property

The identifier for the sort settings modal dialog

protected string $_sortModalId null
$_store protected property

The storage instance

$_visibleColumns protected property

The user configured visible widget columns

protected array $_visibleColumns = []
$_visibleKeys protected property

The stored visible keys

protected array $_visibleKeys = []
$allowFilterSetting public property

Whether to allow display/setup of the filter in the personalize grid form

$allowPageSetting public property

Whether to allow setup of the pagination. Defaults to true.

public boolean $allowPageSetting true
$allowSortSetting public property

Whether to allow display/setup of the sort in the personalize grid form

public boolean $allowSortSetting true
$allowThemeSetting public property

Whether to allow display/setup of the theme. Defaults to true.

$columns public property

The grid columns configuration

public array $columns null
$dbUpdateNameOnly public property

Whether to update only the name, when editing and saving a filter or sort. This is applicable only for $storage set to Dynagrid::TYPE_DB. If set to false, it will also overwrite the current filter or sort settings.

public boolean $dbUpdateNameOnly false
$deleteButtonOptions public property

The HTML attributes for the delete/trash action button. If this is set to false, it will not be displayed. The following special variables are supported:

  • icon: string, the icon class suffix for the button. Defaults to trash for $bsVersion set to 3.x and trash-alt for $bsVersion set to 4.x.
  • prefix: string, the icon class prefix for the button. Defaults to glyphicon glyphicon- for $bsVersion set to 3.x and fas fa- for $bsVersion set to 4.x.
  • label: string, the label for the action button. Defaults to empty string.
  • title: string, the title for the action button. Defaults to Remove saved grid settings.
$deleteConfirmation public property

The confirmation warning message before deleting a personalization configuration or setting.

$deleteMessage public property

The message to display after deleting the configuration and until refreshed grid is reloaded

public string $deleteMessage null
$enableMultiSort public property

Whether to enable multiple sort. Defaults to true.

public boolean $enableMultiSort true
$gridOptions public property

Widget options for \kartik\widgets\GridView that will be rendered by the DynaGrid widget

public array $gridOptions null
$iconConfirm public property

The icon for the save button within the dynagrid configuration form. This is not HTML encoded. Defaults to <i class="glyphicon glyphicon-save"></i> for $bsVersion set to 3.x and <i class="fas fa-save"></i> for $bsVersion set to 4.x.

public string $iconConfirm null
$iconFilter public property

The icon that will be displayed as the label for grid filter personalization button. This is not HTML encoded. Defaults to <i class="glyphicon glyphicon-filter"></i> for $bsVersion set to 3.x and <i class="fas fa-fw fa-filter"></i> for $bsVersion set to 4.x.

public string $iconFilter null
$iconHiddenColumn public property

The icon that will be displayed for each HIDDEN column heading in the column reordering pane. This is not HTML encoded. Defaults to <i class="glyphicon glyphicon-eye-close"></i> for $bsVersion set to 3.x and <i class="fas fa-eye-slash"></i> for $bsVersion set to 4.x.

public string $iconHiddenColumn null
$iconPersonalize public property

The icon that will be displayed on the dynagrid personalize button as well as the personalize modal dialog header. This is not HTML encoded. Defaults to <i class="glyphicon glyphicon-wrench"></i> for $bsVersion set to 3.x and <i class="fas fa-fw fa-wrench"></i> for $bsVersion set to 4.x.

public string $iconPersonalize null
$iconRemove public property

The icon for the save button within the dynagrid configuration form. This is not HTML encoded. Defaults to <i class="glyphicon glyphicon-remove"></i> for $bsVersion set to 3.x and <i class="fas fa-times"></i> for $bsVersion set to 4.x.

public string $iconRemove null
$iconSort public property

The icon that will be displayed as the label for grid sort personalization button. This is not HTML encoded. Defaults to <i class="glyphicon glyphicon-sort"></i> for $bsVersion set to 3.x and <i class="fas fa-fw fa-sort"></i> for $bsVersion set to 4.x.

public string $iconSort null
$iconSortableSeparator public property

The icon that will be displayed separating the visible and hidden columns in the column reordering pane. This is not HTML encoded. Defaults to <i class="glyphicon glyphicon-resize-horizontal"></i> for $bsVersion set to 3.x and <i class="fas fa-arrows-alt-h"></i> for $bsVersion set to 4.x.

$iconVisibleColumn public property

The icon that will be displayed for each VISIBLE column heading in the column reordering pane. This is not HTML encoded. Defaults to <i class="glyphicon glyphicon-eye-open"></i> for $bsVersion set to 3.x and <i class="fas fa-eye"></i> for $bsVersion set to 4.x.

public string $iconVisibleColumn null
$krajeeDialogSettings public property

Configuration settings for the Krajee dialog widget that will be used to render alerts and confirmation dialog prompts

See also http://demos.krajee.com/dialog.

$matchPanelStyle public property

Whether the DynaGrid configuration button class should match the grid panel style.

public boolean $matchPanelStyle null
$messageOptions public property

HTML attributes for the submission message container

public array $messageOptions null
$moduleId public property

The module identifier if this widget is part of a module. If not set, the module identifier will be auto derived based on the \yii\base\Module::getInstance method. This can be useful, if you are setting multiple module identifiers for the same module in your Yii configuration file. To specify children or grand children modules you can specify the module identifiers relative to the parent module (e.g. admin/content).

public string $moduleId null
$options public property

HTML options for the DynaGrid widget

public array $options null
$resetButtonOptions public property

The HTML attributes for the reset action button. If this is set to false, it will not be displayed. The following special variables are supported:

  • icon: string, the icon class suffix for the button. Defaults to repeat for $bsVersion set to 3.x and redo for $bsVersion set to 4.x.
  • prefix: string, the icon class prefix for the button. Defaults to glyphicon glyphicon- for $bsVersion set to 3.x and fas fa- for $bsVersion set to 4.x.
  • label: string, the label for the action button. Defaults to empty string.
  • title: string, the title for the action button. Defaults to Abort any changes and reset settings.
$showFilter public property

Whether to show the filter save widget button. Defaults to true.

public boolean $showFilter true
$showPersonalize public property

Whether to show the personalize button group. Defaults to true.

public boolean $showPersonalize true
$showSort public property

Whether to show the sort save widget button. Defaults to true.

public boolean $showSort true
$sortableHeader public property

The HTML attributes for the sortable columns header

public array $sortableHeader = [
    'class' => 'alert alert-info dynagrid-sortable-header'
]
$sortableOptions public property

The sortable widget options

public array $sortableOptions null
$storage public property

The type of storage for the dynagrid configuration.

public string $storage null
$submitButtonOptions public property

The HTML attributes for the save/apply action button. If this is set to false, it will not be displayed. The following special variables are supported:

  • icon: string, the icon class suffix for the button. Defaults to save.
  • prefix: string, the icon class prefix for the button. Defaults to glyphicon glyphicon- for $bsVersion set to 3.x and fas fa- for $bsVersion set to 4.x.
  • label: string, the label for the action button. Defaults to empty string.
  • title: string, the title for the action button. Defaults to Save grid settings.
$submitMessage public property

The message to display after applying and submitting the configuration and until refreshed grid is reloaded

public string $submitMessage null
$theme public property

The initial grid theme to be set

public string $theme null
$toggleButtonFilter public property

The HTML attributes for the filter configuration button which will render the Filter settings form within a Bootstrap Modal container.

public array $toggleButtonFilter null
$toggleButtonGrid public property

The HTML attributes for the dynagrid personalize toggle button which will render the DynaGrid configuration form within a Bootstrap Modal container.

public array $toggleButtonGrid null
$toggleButtonSort public property

The HTML attributes for the sort configuration button which will render the Sort settings form within a Bootstrap Modal container.

public array $toggleButtonSort null
$userSpecific public property

Whether settings are stored specific to each user

public boolean $userSpecific null

Method Details

applyColumns() protected method

Applies the configured columns

protected void applyColumns ( )
applyFilter() protected method

Applies the grid filter

protected void applyFilter ( )
applyGridConfig() protected method

Applies the current grid configuration

protected void applyGridConfig ( )
throws yii\base\InvalidConfigException
applyPageSize() protected method

Applies the page size

protected void applyPageSize ( )
applySort() protected method

Applies the grid sort

protected void applySort ( )
applyTheme() protected method

Applies the configured theme

protected void applyTheme ( )
canReorder() protected method

Can the column be reordered

protected boolean canReorder ( $column )
$column mixed
throws Exception
configureColumns() protected method

Reconfigure columns with unique keys

protected void configureColumns ( )
throws yii\base\InvalidConfigException
getAttributeLabel() protected method

Generates the attribute label

protected string getAttributeLabel ( $attribute )
$attribute
getColumnKey() protected method

Generate an unique column key

protected false|string getColumnKey ( $column )
$column mixed
throws yii\base\InvalidConfigException
getColumnLabel() protected method

Fetches the column label

protected string getColumnLabel ( $key, $column )
$key mixed

The column key

$column mixed

The column object / configuration

throws yii\base\InvalidConfigException
getColumns() public method

Gets the columns for the dynagrid

public array getColumns ( )
getDefaultButtonOptions() protected method

Get the default action button option settings

protected array getDefaultButtonOptions ( $type )
$type string

The button type

return array

The button settings

throws \yii\base\InvalidConfigException|\Exception
getGridConfig() protected method

Gets the current grid configuration

protected array getGridConfig ( $current false )
$current boolean

Whether it is the currently set grid configuraton

throws yii\base\InvalidConfigException
getSortableHeader() protected method

Generates the config for sortable widget header

protected array getSortableHeader ( $label )
$label string
initDataProvider() protected method

Initialize the data provider

protected void initDataProvider ( $searchModel )
$searchModel yii\base\Model
initGrid() protected method

Initialize the grid view for dynagrid

protected void initGrid ( )
throws yii\base\InvalidConfigException
throws Exception
initIcons() protected method

Initializes icon properties with default values

protected void initIcons ( )
throws \yii\base\InvalidConfigException|\Exception
initModule() protected method

Initialize the module based on module identifier

protected void initModule ( )
throws yii\base\InvalidConfigException
initWidget() protected method

Initializes widget settings and options

protected void initWidget ( )
throws yii\base\InvalidConfigException
isVisible() protected static method

Is column visible

protected static boolean isVisible ( $column )
$column mixed
throws Exception
loadAttributes() protected method

Load configuration attributes into DynaGridConfig model

protected void loadAttributes ( $model )
$model kartik\dynagrid\models\DynaGridConfig
throws yii\base\InvalidConfigException
loadGridConfig() protected method

Load grid configuration from specific storage

protected void loadGridConfig ( $config = [] )
$config array

The configuration to load

throws yii\base\InvalidConfigException
matchColumnString() protected method

Finds the matches for a string column format

protected array matchColumnString ( $column )
$column string
throws yii\base\InvalidConfigException
parseData() protected method

Parses the encoded grid configuration and fetches - grid master settings: the theme, pagesize, visible keys - grid detail settings: filter and sort configuration

protected void parseData ( $data )
$data array

The stored data to be parsed

throws yii\base\InvalidConfigException
parseDetailData() protected method

Parses the grid detail configuration (for filter or sort).

protected void parseDetailData ( $category )
$category string

One of 'filter' or 'sort'

throws yii\base\InvalidConfigException
pjaxCleanupJs() protected method

Generates the cleanup client script for modals

protected string pjaxCleanupJs ( $type )
$type string

The modal container type 'grid', 'filter', or 'sort'

prepareColumns() protected method

Prepares the columns for the dynagrid

protected void prepareColumns ( )
registerAssets() protected method

Registers client assets

protected void registerAssets ( )
throws Exception
renderActionButton() protected method

Renders the action button

protected string renderActionButton ( $type )
$type string

The button type

return string

The rendered button

throws yii\base\InvalidConfigException
run() public method

Executes the widget.

public string|void run ( )
return string|void

The rendering result may be directly "echoed" or returned as a string

throws yii\base\InvalidConfigException
throws Exception
saveGridConfig() protected method

Update configuration

protected void saveGridConfig ( $config, $delete )
$config array

The dynagrid configuration

$delete boolean

The deletion flag

throws yii\base\InvalidConfigException
setToggleButton() protected method

Sets the personalization toggle button

protected void setToggleButton ( $cat )
$cat string

The category 'grid', 'filter', or 'sort'

throws \yii\base\InvalidConfigException|\Exception
setWidgetColumns() protected method

Sets widget columns for display in kartik\sortable\Sortable widget

protected void setWidgetColumns ( )
throws yii\base\InvalidConfigException