Class yii\jui\Widget

Inheritanceyii\jui\Widget » yii\base\Widget
Subclassesyii\jui\Accordion, yii\jui\AutoComplete, yii\jui\DatePicker, yii\jui\Dialog, yii\jui\Draggable, yii\jui\Droppable, yii\jui\InputWidget, yii\jui\ProgressBar, yii\jui\Resizable, yii\jui\Selectable, yii\jui\Slider, yii\jui\SliderInput, yii\jui\Sortable, yii\jui\Spinner, yii\jui\Tabs
Available since version2.0

\yii\jui\Widget is the base class for all jQuery UI widgets.

Public Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
$clientEvents array The event handlers for the underlying jQuery UI widget. yii\jui\Widget
$clientOptions array The options for the underlying jQuery UI widget. yii\jui\Widget
$options array The HTML attributes for the widget container tag. yii\jui\Widget

Protected Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
$clientEventMap array Event names mapped to what should be specified in `. yii\jui\Widget

Public Methods

Hide inherited methods

MethodDescriptionDefined By
init() Initializes the widget. yii\jui\Widget

Protected Methods

Hide inherited methods

MethodDescriptionDefined By
registerClientEvents() Registers a specific jQuery UI widget events yii\jui\Widget
registerClientOptions() Registers a specific jQuery UI widget options yii\jui\Widget
registerWidget() Registers a specific jQuery UI widget asset bundle, initializes it with client options and registers related events yii\jui\Widget

Property Details

$clientEventMap protected property

Event names mapped to what should be specified in .on(). If empty, it is assumed that event passed to clientEvents is prefixed with widget name.

protected array $clientEventMap = []
$clientEvents public property

The event handlers for the underlying jQuery UI widget. Please refer to the corresponding jQuery UI widget Web page for possible events. For example, this page shows how to use the "Accordion" widget and the supported events (e.g. "create"). Keys are the event names and values are javascript code that is passed to the .on() function as the event handler.

For example you could write the following in your widget configuration:

'clientEvents' => [
    'change' => 'function () { alert('event "change" occured.'); }'
],
public array $clientEvents = []
$clientOptions public property

The options for the underlying jQuery UI widget. Please refer to the corresponding jQuery UI widget Web page for possible options. For example, this page shows how to use the "Accordion" widget and the supported options (e.g. "header").

public array $clientOptions = []
$options public property

The HTML attributes for the widget container tag.

See also \yii\helpers\Html::renderTagAttributes() for details on how attributes are being rendered.

public array $options = []

Method Details

init() public method

Initializes the widget.

If you override this method, make sure you call the parent implementation first.

public void init ( )
registerClientEvents() protected method

Registers a specific jQuery UI widget events

protected void registerClientEvents ( $name, $id )
$name string

The name of the jQuery UI widget

$id string

The ID of the widget

registerClientOptions() protected method

Registers a specific jQuery UI widget options

protected void registerClientOptions ( $name, $id )
$name string

The name of the jQuery UI widget

$id string

The ID of the widget

registerWidget() protected method

Registers a specific jQuery UI widget asset bundle, initializes it with client options and registers related events

protected void registerWidget ( $name, $id null )
$name string

The name of the jQuery UI widget

$id string

The ID of the widget. If null, it will use the id value of $options.