kartik-v / yii2-widget-switchinput

A Yii2 wrapper widget for the Bootstrap Switch plugin to use checkboxes & radios as toggle switches (sub repo split from yii2-widgets)
Other
38 stars 11 forks source link

switchChange #9

Closed fbarchi closed 9 years ago

fbarchi commented 9 years ago

Hi, first of all congrats for your big and very usefull work. I pass from 1.0.0 (bootstrap-switch 3.0.0) to 1.2.0 ((bootstrap-switch 3.2.2) but when i create this SwitchInput:

$form->field($model, 'my_field')->widget(SwitchInput::className(), [
    'inlineLabel' => false,
    "pluginEvents"=>[
        "switchChange" => "function() { $(\"#my_div_id\").toggle(100); }",
    ],
    'pluginOptions' => [
        'onText' => 'Si',
        'offText' => 'No',
        'onColor' => 'success',
        'offColor' => 'danger',
    ]
])

the event doesn't start. why? is an error of js or widget?

regards, Francesco

kartik-v commented 9 years ago

The event is named switchChange.bootstrapSwitch.