Control doesn't change state when disabled or readonly
If a checkbox is disabled and the value it is bound to is altered from true to false the checkbox is unchecked. Its still disabled or readonly but the value is updated.
The bootstrap-switch doesn't work this way. When the bootstrap-switch is disabled or readonly and the value its bound to is altered the state doesn't change therefore becoming out of sync with the underlying value.
The switch's state should stay in sync with the value the switch is bound to.
:+1: Related to https://github.com/frapontillo/angular-bootstrap-switch/issues/68
I also have this need, it will be awesome if toggleDisabled/toggleReadonly methods accept a second parameter, to tell if the state have to remain in sync also if disabled/readonly.
Is this still a "work in progress"? It would be great if this can be done. One switch relates to another disabled switch's value.
I tried to do this using jQuery:
$('input[name="obstacleStreet"]').on('switchChange.bootstrapSwitch', function (e, state){
$('input[name="obstacleBowl"]').bootstrapSwitch('toggleDisabled', false);
$('input[name="obstacleBowl"]').bootstrapSwitch('state', state);
$('input[name="obstacleBowl"]').bootstrapSwitch('toggleDisabled');
});
But still not working. If this is a known issue, is there any plan to make it available soon? Thank you