An extended checkbox widget for Yii Framework 2 based on the bootstrap-checkbox-x jQuery plugin by Krajee. This widget allows three checkbox states and includes additional styles. The plugin uses Bootstrap markup, glyphs, and CSS 3 styling by default, but it can be overridden with any other markup.
NOTE: The checkbox plugin stores the values as integer format (and not boolean format) for checked and unchecked states.
1
: Checkbox is checked.0
: Checkbox is unchecked.null
: Checkbox is indeterminate.has-error
, has-success
, has-warning
styling states like other Bootstrap form-controls.label
before or after with a for
attribute and click on the label to change the checkbox values. Alternatively you can enclose the
input within a label
tag as well.space
bar on the keyboard.xl
, lg
, md
, sm
, and xs
.change
event for the input, whenever the checkbox value is changed via clicking. Events currently available are change
and reset
.You can see detailed docs and demos and the API code documentation on usage of the extension.
Refer the CHANGE LOG for details on changes to various releases.
The preferred way to install this extension is through composer.
NOTE: Check the composer.json for this extension's requirements and dependencies. Read this web tip /wiki on setting the
minimum-stability
settings for your application's composer.json.
Either run
$ php composer.phar require kartik-v/yii2-checkbox-x "@dev"
or add
"kartik-v/yii2-checkbox-x": "@dev"
to the require
section of your composer.json
file.
use kartik\checkbox\CheckboxX;
echo CheckboxX::widget([
'model' => $model,
'attribute' => 'status',
'pluginOptions' => [
'threeState' => true,
'size' => 'lg'
]
]);
yii2-checkbox-x is released under the BSD-3-Clause License. See the bundled LICENSE.md
for details.
yii2-checkbox-x
Date: 10-Jan-2022
Date: 01-Sep-2021
Date: 01-Sep-2021
Date: 09-Oct-2018
Date: 11-Jan-2016
Date: 20-Sep-2015
Date: 17-Jun-2015
labelSettings
property to allow configuring checkbox labels better.autoLabel
property to allow automatic configuration of label text, styles, and positions.initInputType
property to set input type for initializing bootstrap-checkbox-x plugin.Date: 09-Nov-2014
Comments