Yes/No Panel API
Yes/No Panel Overview
Provides a means to create panels that select and only select one of two choices, such as yes or no. This component is not intended to be used on its own, but provided as a base grade to another component that will use it's capabilities for creating such panels. An UI example of one of these panels:
Join the infusion-users mailing list and ask your questions there.
Adding a Yes/No Panel to a Component/Grade
To mixin the Yes/No Panel into your Component/Grade:
fluid.defaults( "my.component" , { gradeNames: [ "gpii.firstDiscovery.panel.yesNo" , "autoInit" ] }); |
Grades
The base grades used by the Yes/No Panel:
Model
Path | Description | Values | Default |
---|---|---|---|
| The corresponding boolean value of the selected choice.
| Boolean | undefined |
choice | The selected choice. | String | undefined |
Options
Name | Description | Values | Default |
---|---|---|---|
| An object that contains a "choice" element that determines choice values assigned to HTML radio buttons. | Object "choice" value is an array with two elements. | controlValues: { choice: ["yes", "no"] } |
Selectors
One of the options that can be provided to the First Discovery Editor is a set of CSS-based selectors identifying where in the DOM different elements can be found. The value for the option is itself a Javascript object containing name/value pairs:
selectors: { selector1Name: "selector 1 string", selector2Name: "selector 2 string", ... }
Selector Name | Description | Default |
---|---|---|
| The row of each choice. It often contains | ".gpiic-fd-yesNo-choiceRow" |
choiceLabel | The label for each choice button | ".gpiic-fd-yesNo-choiceLabel" |
choiceInput | The <input> tag for each choice button | ".gpiic-fd-yesNo-choiceInput" |
instructions | The container to display the panel instruction. | ".gpiic-fd-yesNo-instructions" |
Dependencies
<script type="text/javascript" src="src/lib/infusion/infusion-custom.js"></script> <script type="text/javascript" src="src/js/msgLookup.js"></script> <script type="text/javascript" src="src/js/tooltip.js"></script> <script type="text/javascript" src="src/js/panels.js"></script>