December 2017
Intermediate to advanced
282 pages
5h 54m
English
Create an ojSwitch component using the ojComponent binding with an ID. To review the value of the switch element, create an HTML label with the for attribute referring to the value of the ID from ojSwitch. Populate the value from the model layer. The following is the example for the switch component selection:
<form id="formId"> <label id="switchLabel" for="status">Employment Status</label> <input id="status" data-bind="ojComponent: {component: 'ojSwitch', value: isChecked}"/> <br/><br/> <span> Employment Status is </span> <span data-bind="text: ((isChecked()) ? 'Active' : 'Inactive')"> </span> </form>
require(['ojs/ojcore', 'knockout', 'jquery', 'ojs/ojknockout', 'ojs/ojswitch'], function(oj, ko, $) { function ...Read now
Unlock full access