Class kartik\base\Widget
Inheritance | kartik\base\Widget » yii\base\Widget |
---|---|
Uses Traits | kartik\base\TranslationTrait, kartik\base\WidgetTrait |
Subclasses | kartik\tree\TreeView, kartik\tree\TreeViewInput |
Available since version | 1.0 |
Base widget class for Krajee extensions
Public Properties
Property | Type | Description | Defined By |
---|---|---|---|
$i18n | array | The the internalization configuration for this widget | kartik\base\Widget |
$options | array | HTML attributes or other settings for widgets | kartik\base\Widget |
$pluginEvents | array | Widget JQuery events. | kartik\base\Widget |
$pluginOptions | array | Widget plugin options | kartik\base\Widget |
Protected Properties
Property | Type | Description | Defined By |
---|---|---|---|
$_dataVar | string | The element's HTML5 data variable name storing the pluginOptions | kartik\base\Widget |
$_encOptions | string | The Json encoded options | kartik\base\Widget |
$_hashVar | string | The hashed global variable name storing the pluginOptions | kartik\base\Widget |
$_msgCat | string | Translation message file category name for i18n | kartik\base\Widget |
$_pluginName | string | The name of the jQuery plugin | kartik\base\Widget |
Public Methods
Method | Description | Defined By |
---|---|---|
init() | kartik\base\Widget | |
initI18N() | Yii i18n messages configuration for generating translations | kartik\base\TranslationTrait |
Protected Methods
Method | Description | Defined By |
---|---|---|
addAsset() | Adds an asset to the view | kartik\base\WidgetTrait |
getPluginScript() | Returns the plugin registration script | kartik\base\WidgetTrait |
hashPluginOptions() | Generates a hashed variable to store the pluginOptions. The following special data attributes will also be setup for the input widget, that can be accessed through javascript : - 'data-krajee-{name}' will store the hashed variable storing the plugin options. The {name} tag will represent the plugin name (e.g. select2, typeahead etc.) - Fixes issue #6. | kartik\base\WidgetTrait |
registerPlugin() | Registers a specific plugin and the related events | kartik\base\WidgetTrait |
registerPluginOptions() | Registers plugin options by storing it in a hashed javascript variable | kartik\base\WidgetTrait |
setDataVar() | Sets HTML5 data variable | kartik\base\WidgetTrait |
Property Details
The element's HTML5 data variable name storing the pluginOptions
The Json encoded options
The hashed global variable name storing the pluginOptions
Translation message file category name for i18n
The name of the jQuery plugin
The the internalization configuration for this widget
HTML attributes or other settings for widgets
Widget JQuery events. You must define events in event-name => event-function format for example: ~~~ pluginEvents = [
"change" => "function() { log("change"); }",
"open" => "function() { log("open"); }",
]; ~~~
Widget plugin options