bootstrap-switch

Disable bootstrap switch after onswitchchange

喜欢而已 提交于 2020-01-03 17:20:28
问题 I am new at coding with bootstrap and jquery. how can i disable bootstrap switch in "onswitchchange" method option Here my javascript/jquery code: $("input[type=checkbox]").bootstrapSwitch({ size:"mini", onSwitchChange:function(event, state) { this.disabled = true; //checkbox change into disabled } }); i also tried to change this.disabled = true into $(this).setDisabled(true); and it returning error of course. i just want to know how to call setDisable method inside onswitchchange method. if

Angular 2: Bootstrap Switch not changing value of variable

好久不见. 提交于 2019-12-23 04:38:25
问题 I'm using bootstap switches for checkboxes in my Angular 2 application. When you click on the switch, I want the value of my LightNeeded variable in my class to change along with it. I have the following code: HTML: <input class="bootstrap-switch light-needed" name="LightNeeded" type="checkbox" [(ngModel)]="LightNeeded"> TypeScript file: LightNeeded: boolean; ngOnInit(): void { // Invoke bootstrap switches $('.bootstrap-switch').bootstrapSwitch({ onText: "Yes", offText: "No" }); this

Angular 2: Bootstrap Switch not changing value of variable

时光毁灭记忆、已成空白 提交于 2019-12-23 04:38:05
问题 I'm using bootstap switches for checkboxes in my Angular 2 application. When you click on the switch, I want the value of my LightNeeded variable in my class to change along with it. I have the following code: HTML: <input class="bootstrap-switch light-needed" name="LightNeeded" type="checkbox" [(ngModel)]="LightNeeded"> TypeScript file: LightNeeded: boolean; ngOnInit(): void { // Invoke bootstrap switches $('.bootstrap-switch').bootstrapSwitch({ onText: "Yes", offText: "No" }); this

AngularJs ng-repeat track by $index issue with angular-bootstrap-switch [duplicate]

流过昼夜 提交于 2019-12-21 22:43:49
问题 This question already has an answer here : Problems with `track by $index` with Angular UI Carousel (1 answer) Closed last year . I am having an issue with AngularJs ng-repeat and angular-bootstrap-switch I am using: ng-repeat="item in items track by $index" When I added a new item into the first index of array by: newItem = {}; items.splice(0, 0, newItem); The DOM contain a bs-switch: When a new item added it reuse the first element in array base on $index, so it doesn't re-render (that's

rails 4 : change state issue with Bootstrap Switch

久未见 提交于 2019-12-12 05:27:04
问题 I have 3 bootstrap switches to handle read/update/create permissions. They area written as : <%= f.check_box :allow_read, :data => { :size=>'medium', 'on-color'=>'success', 'on-text'=> "#{t('yes').upcase}", 'off-text'=> "#{t('no').upcase}" } %> <%= f.check_box :allow_update, :data => { :size=>'medium', 'on-color'=>'success', 'on-text'=> "#{t('yes').upcase}", 'off-text'=> "#{t('no').upcase}" } %> <%= f.check_box :allow_create, :data => { :size=>'medium', 'on-color'=>'success', 'on-text'=> "#{t

height issue in bootstrap switch

流过昼夜 提交于 2019-12-12 01:54:38
问题 Bootstrap switch with on text 'Yes' I am facing the problem with height in Bootstrap switch. I am not able to change the height of the switch. How can I change the height of the switch. 回答1: Just add following css to your page and adjust height, padding and margin according your design. div.bootstrap-switch-container { height: 25px; } .bootstrap-switch .bootstrap-switch-handle-on, .bootstrap-switch .bootstrap-switch-handle-off, .bootstrap-switch .bootstrap-switch-label { padding: 3px 12px; }

Bootstrap Switch not firing SetState event in angular directive

ⅰ亾dé卋堺 提交于 2019-12-11 14:36:00
问题 i am using a Wrapbootstrap template. and converted it into a single page application using its routing and ng-view kind of a stuff. this third party template seems to be using bootstrap switch. but its not referencing bootstrap-switch.js, instead it has something called toggler.js which transforms element with 'make-switch' class into a switch. Question 1 : Has the vendor tweaked Bootstrap Switch v2.0 to make this JS ? code of toggler.js ! function(e) { "use strict"; e.fn.bootstrapSwitch =