UNPKG

jqwidgets-framework

Version:

jQWidgets is an advanced Angular, Vue, Blazor, React, Web Components, jquery, ASP .NET MVC, Custom Elements and HTML5 UI framework.

866 lines (856 loc) 45.3 kB
<!DOCTYPE html> <html lang="en"> <head> <link rel="stylesheet" href="../../../../Styles/jqx.apireference.css" type="text/css" /> <script type="text/javascript" src="../../../../scripts/jquery-1.10.2.min.js"></script> <script type="text/javascript" src="../../../../scripts/documentation.js"></script> <meta name="keywords" content="jQuery, Radio Button, RadioButton, CheckInput, RadioInput, Button" /> <meta name="description" content="This page represents the help documentation of the jqxRadioButton and jqxRadioButton widgets." /> <title>jqxRadioButton and jqxRadioButton API Reference</title> <script type="text/javascript"> $(document).ready(function () { $(".documentation-option-type-click").click(function (event) { $(event.target).parents('tr').next().find(".property-content").toggle(); }); }); </script> </head> <body> <div id="properties"> <h2 class="documentation-top-header">Properties</h2> <table class="documentation-table"> <tr> <th>Name </th> <th>Type </th> <th>Default </th> </tr> <tr> <td class="documentation-option-type-click"> <span id='Span3'>animationShowDelay</span> </td> <td> <span>Number</span> </td> <td>250 </td> </tr> <tr> <td colspan='3' style='width: 100%'> <div class="documentation-option-description property-content" style="display: none;"> <p> Sets or gets the delay of the fade animation when the Radio Button is going to be checked. </p> <h4>Code examples</h4> <p> Set the <code>animationShowDelay</code> property. </p> <pre><code>$('#jqxRadioButton').jqxRadioButton({ animationShowDelay: 200 }); </code></pre> <p> Get the <code>animationShowDelay</code> property. </p> <pre><code>var animationShowDelay = $('#jqxRadioButton').jqxRadioButton('animationShowDelay'); </code></pre> <div style="padding-bottom: 5px;"> <em>Try it:</em> <a target="_blank" href="http://jsfiddle.net/jqwidgets/cPmyp/">animationShowDelay is set to 500</a> </div> </div> </td> </tr> <tr> <td class="documentation-option-type-click"> <span id='Span4'>animationHideDelay</span> </td> <td> <span>Number</span> </td> <td>300 </td> </tr> <tr> <td colspan='3' style='width: 100%'> <div class="documentation-option-description property-content" style="display: none;"> <p> Sets or gets the delay of the fade animation when the Radio Button is going to be unchecked. </p> <h4>Code examples</h4> <p> Set the <code>animationHideDelay</code> property. </p> <pre><code>$('#jqxRadioButton').jqxRadioButton({ animationHideDelay: 200 }); </code></pre> <p> Get the <code>animationHideDelay</code> property. </p> <pre><code>var animationHideDelay = $('#jqxRadioButton').jqxRadioButton('animationHideDelay'); </code></pre> <div style="padding-bottom: 5px;"> <em>Try it:</em> <a target="_blank" href="http://jsfiddle.net/jqwidgets/eS3zM/">animationHideDelay is set to 500</a> </div> </div> </td> </tr> <tr> <td class="documentation-option-type-click"> <span id='Span5'>boxSize</span> </td> <td> <span>String</span> </td> <td>"13px" </td> </tr> <tr> <td colspan='3' style='width: 100%'> <div class="documentation-option-description property-content" style="display: none;"> <p> Sets or gets the Radio Button's size. </p> <h4>Code examples</h4> <p> Set the <code>boxSize</code> property. </p> <pre><code>$('#jqxRadioButton').jqxRadioButton({ boxSize:"15px" }); </code></pre> <p> Get the <code>boxSize</code> property. </p> <pre><code>var boxSize = $('#jqxRadioButton').jqxRadioButton('boxSize'); </code></pre> <div style="padding-bottom: 5px;"> <em>Try it:</em> <a target="_blank" href="http://jsfiddle.net/jqwidgets/FQt4b/">boxSize is set to '15px'</a> </div> </div> </td> </tr> <tr> <td class="documentation-option-type-click"> <span id="Span6">checked</span> </td> <td> <span>Boolean</span> </td> <td>false </td> </tr> <tr> <td colspan="3" style="width: 100%"> <div class="documentation-option-description property-content" style="display: none;"> <p> Sets or gets whether the radio button is checked. </p> <h4>Code examples</h4> <p> Set the <code>checked</code> property. </p> <pre><code>$('#jqxRadioButton').jqxRadioButton({ checked:true }); </code></pre> <p> Get the <code>checked</code> property. </p> <pre><code>var checked = $('#jqxRadioButton').jqxRadioButton('checked'); </code></pre> <div style="padding-bottom: 5px;"> <em>Try it:</em> <a target="_blank" href="http://jsfiddle.net/jqwidgets/yNjnM/">checked is set to true</a> </div> </div> </td> </tr> <tr> <td class="documentation-option-type-click"> <span id='Span2'>disabled</span> </td> <td> <span>Boolean</span> </td> <td>false </td> </tr> <tr> <td colspan='3' style='width: 100%'> <div class="documentation-option-description property-content" style="display: none;"> <p> Sets or gets whether the Radio Button is disabled. </p> <h4>Code examples</h4> <p> Set the <code>disabled</code> property. </p> <pre><code>$('#jqxRadioButton').jqxRadioButton({ disabled:true }); </code></pre> <p> Get the <code>disabled</code> property. </p> <pre><code>var disabled = $('#jqxRadioButton').jqxRadioButton('disabled');</code></pre> <div style="padding-bottom: 5px;"> <em>Try it:</em> <a target="_blank" href="http://jsfiddle.net/jqwidgets/DZ8dG/">disabled is set to true</a> </div> </div> </td> </tr> <tr> <td class="documentation-option-type-click"> <span id='Span8'>enableContainerClick</span> </td> <td> <span>Boolean</span> </td> <td>true </td> </tr> <tr> <td colspan='3' style='width: 100%'> <div class="documentation-option-description property-content" style="display: none;"> <p> Sets or gets whether the clicks on the container are handled as clicks on the rounded button. </p> <h4>Code examples</h4> <p> Set the <code>enableContainerClick</code> property. </p> <pre><code>$('#jqxRadioButton').jqxRadioButton({enableContainerClick :true }); </code></pre> <p> Get the <code>enableContainerClick</code> property. </p> <pre><code>var enableContainerClick = $('#jqxRadioButton').jqxRadioButton('enableContainerClick'); </code></pre> <div style="padding-bottom: 5px;"> <em>Try it:</em> <a target="_blank" href="http://jsfiddle.net/jqwidgets/3KcAA/">enableContainerClick is set to false</a> </div> </div> </td> </tr> <tr> <td class="documentation-option-type-click"> <span id='Span10'>groupName</span> </td> <td> <span>String</span> </td> <td>"" </td> </tr> <tr> <td colspan='3' style='width: 100%'> <div class="documentation-option-description property-content" style="display: none;"> <p> Sets or gets the group name. When this property is set, checking a radio button from the group, will uncheck only the radio buttons from the same group. </p> <h4>Code examples</h4> <p> Set the <code>groupName</code> property. </p> <pre><code>$('#jqxRadioButton').jqxRadioButton({groupName :"Panel" }); </code></pre> <p> Get the <code>groupName</code> property. </p> <pre><code>var groupName = $('#jqxRadioButton').jqxRadioButton('groupName'); </code></pre> <div style="padding-bottom: 5px;"> <em>Try it:</em> <a target="_blank" href="http://jsfiddle.net/jqwidgets/XH6ch/">groupName is set to "Group"</a> </div> </div> </td> </tr> <tr> <td class="documentation-option-type-click"> <span id='Span7'>hasThreeStates</span> </td> <td> <span>Boolean</span> </td> <td>false </td> </tr> <tr> <td colspan='3' style='width: 100%'> <div class="documentation-option-description property-content" style="display: none;"> <p> Sets or gets whether the radio button has 3 states - checked, unchecked and indeterminate. </p> <h4>Code examples</h4> <p> Set the <code>hasThreeStates</code> property. </p> <pre><code>$('#jqxRadioButton').jqxRadioButton({ hasThreeStates:true }); </code></pre> <p> Get the <code>hasThreeStates</code> property. </p> <pre><code>var hasThreeStates = $('#jqxRadioButton').jqxRadioButton('hasThreeStates'); </code></pre> <div style="padding-bottom: 5px;"> <em>Try it:</em> <a target="_blank" href="http://jsfiddle.net/jqwidgets/kzGSs/">hasThreeStates is set to true</a> </div> </div> </td> </tr> <tr> <td class="documentation-option-type-click"> <span id='Span1'>height</span> </td> <td> <span>Number/String</span> </td> <td>null </td> </tr> <tr> <td colspan='3' style='width: 100%'> <div class="documentation-option-description property-content" style="display: none;"> <p> Sets or gets the jqxRadioButton's height. </p> <h4>Code examples</h4> <p> Set the <code>height</code> property. </p> <pre><code>$('#jqxRadioButton').jqxRadioButton({height:"400px"});</code></pre> <p> Get the <code>height</code> property. </p> <pre><code>var height = $('#jqxRadioButton').jqxRadioButton('height');</code></pre> <div style="padding-bottom: 5px;"> <em>Try it:</em> <a target="_blank" href="http://jsfiddle.net/jqwidgets/PAka5/">height is set to 25</a> </div> </div> </td> </tr> <tr> <td class="documentation-option-type-click"> <span id='Span51'>rtl</span> </td> <td> <span>Boolean</span> </td> <td>false </td> </tr> <tr> <td colspan='3' style='width: 100%'> <div class="documentation-option-description property-content" style="display: none;"> <p>Sets or gets a value indicating whether widget's elements are aligned to support locales using right-to-left fonts.</p> <h4>Code example</h4> <p> Set the <code>rtl</code> property. </p> <pre><code>$('#jqxRadioButton').jqxRadioButton({rtl : true}); </code></pre> <p> Get the <code>rtl</code> property. </p> <pre><code>var rtl = $('#jqxRadioButton').jqxRadioButton('rtl'); </code></pre> <div style="padding-bottom: 5px;"> <em>Try it:</em> <a target="_blank" href="http://jsfiddle.net/jqwidgets/4vAx9/">rtl is set to true</a> </div> </div> </td> </tr> <tr> <td class="documentation-option-type-click"> <span id='Span63'>theme</span> </td> <td> <span>String</span> </td> <td>'' </td> </tr> <tr> <td colspan='3' style='width: 100%'> <div class="documentation-option-description property-content" style="display: none;"> <p> Sets the widget's theme. </p> jQWidgets uses a pair of css files - jqx.base.css and jqx.[theme name].css. The base stylesheet creates the styles related to the widget's layout like margin, padding, border-width, position. The second css file applies the widget's colors and backgrounds. The jqx.base.css should be included before the second CSS file. In order to set a theme, you need to do the following: <ul> <li>Include the theme's CSS file after jqx.base.css.<br /> The following code example adds the 'energyblue' theme. <pre><code> <pre><code>&lt;link rel=&quot;stylesheet&quot; href=&quot;../../../../jqwidgets/styles/jqx.base.css&quot; type=&quot;text/css&quot; /&gt; &lt;link rel=&quot;stylesheet&quot; href=&quot;../../../../jqwidgets/styles/jqx.energyblue.css&quot; type=&quot;text/css&quot; /&gt; </code></pre> </code></pre> </li> <li>Set the widget's theme property to 'energyblue' when you initialize it. </li> </ul> <div style="padding-bottom: 5px;"> <em>Try it:</em> <a target="_blank" href="http://jsfiddle.net/jqwidgets/zUmQC/">theme is set to 'energyblue'</a> </div> </div> </td> </tr> <tr> <td class="documentation-option-type-click"> <span id='property-name-disabled'>width</span> </td> <td> <span>Number/String</span> </td> <td>null </td> </tr> <tr> <td colspan='3' style='width: 100%'> <div class="documentation-option-description property-content" style="display: none;"> <p> Sets or gets the jqxRadioButton's width. </p> <h4>Code examples</h4> <p> Set the <code>width</code> property. </p> <pre><code>$('#jqxRadioButton').jqxRadioButton({width:"200px"});</code></pre> <p> Get the <code>width</code> property. </p> <pre><code>var width = $('#jqxRadioButton').jqxRadioButton('width');</code></pre> <div style="padding-bottom: 5px;"> <em>Try it:</em> <a target="_blank" href="http://jsfiddle.net/jqwidgets/G4WWw/">width is set to 120</a> </div> </div> </td> </tr> <tr> <td colspan='3' style='width: 100%'> <h2 class="documentation-top-header">Events</h2> </td> </tr> <tr> <td class="documentation-option-type-click"> <span id='Span27'>checked</span> </td> <td> <span>Event</span> </td> <td></td> </tr> <tr> <td colspan='3' style='width: 100%'> <div class="documentation-option-description property-content" style="display: none;"> <p> This event is triggered when the Radio Button is checked. </p> <h4>Code examples</h4> <p> Bind to the <code>checked</code> event by type: jqxRadioButton. </p> <pre><code>$('#jqxRadioButton').on('checked', function (event) { // Some code here. }); </code></pre> <div style="padding-bottom: 5px;"> <em>Try it:</em> <a target="_blank" href="http://jsfiddle.net/jqwidgets/mqePx/">Bind to the checked event by type: jqxRadioButton.</a> </div> </div> </td> </tr> <tr> <td class="documentation-option-type-click"> <span id='Span13'>change</span> </td> <td> <span>Event</span> </td> <td></td> </tr> <tr> <td colspan='3' style='width: 100%'> <div class="documentation-option-description property-content" style="display: none;"> <p> This is triggered when the Radio Button's state changes from one state to another. </p> <h4>Code examples</h4> <p> Bind to the <code>change</code> event by type: jqxRadioButton. </p> <pre><code>$('#jqxRadioButton').on('change', function (event) { var checked = event.args.checked; var type = event.args.type; // keyboard, mouse or null depending on how the value was changed. }); </code></pre> <div style="padding-bottom: 5px;"> <em>Try it:</em> <a target="_blank" href="http://jsfiddle.net/jqwidgets/BcQk4/">Bind to the change event by type: jqxRadioButton.</a> </div> </div> </td> </tr> <tr> <td class="documentation-option-type-click"> <span id='Span11'>unchecked</span> </td> <td> <span>Event</span> </td> <td></td> </tr> <tr> <td colspan='3' style='width: 100%'> <div class="documentation-option-description property-content" style="display: none;"> <p> This event is triggered when the Radio Button is unchecked. </p> <h4>Code examples</h4> <p> Bind to the <code>unchecked</code> event by type: jqxRadioButton. </p> <pre><code>$('#jqxRadioButton').on('unchecked', function (event) { // Some code here. }); </code></pre> <div style="padding-bottom: 5px;"> <em>Try it:</em> <a target="_blank" href="http://jsfiddle.net/jqwidgets/MTrHD/">Bind to the unchecked event by type: jqxRadioButton.</a> </div> </div> </td> </tr> <tr> <td colspan='3' style='width: 100%'> <h2 class="documentation-top-header">Methods</h2> </td> </tr> <tr> <td class="documentation-option-type-click"> <span id='Span37'>check</span> </td> <td> <span>Method</span> </td> <td></td> </tr> <tr> <td colspan='3' style='width: 100%'> <div class="documentation-option-description property-content" style="display: none;"> <p> Checks the radio button. </p> <div class="methodArgs"> <table class="arguments"> <tbody> <tr> <th>Parameter</th> <th>Type</th> <th>Description</th> </tr> <tr> <td><em>None</em></td> <td></td> <td></td> </tr> </tbody> </table> <strong>Return Value</strong><br /> <em>None</em> </div> <h4>Code example</h4> <p> Invoke the <code>check</code> method. </p> <pre><code>$('#jqxRadioButton').jqxRadioButton('check');</code></pre> <div style="padding-bottom: 5px;"> <em>Try it:</em> <a target="_blank" href="http://jsfiddle.net/jqwidgets/WXqTV/">checks a button in the jqxRadioButton.</a> </div> </div> </td> </tr> <tr> <td class="documentation-option-type-click"> <span id='Span17'>disable</span> </td> <td> <span>Method</span> </td> <td></td> </tr> <tr> <td colspan='3' style='width: 100%'> <div class="documentation-option-description property-content" style="display: none;"> <p> Disables the radio button. </p> <div class="methodArgs"> <table class="arguments"> <tbody> <tr> <th>Parameter</th> <th>Type</th> <th>Description</th> </tr> <tr> <td><em>None</em></td> <td></td> <td></td> </tr> </tbody> </table> <strong>Return Value</strong><br /> <em>None</em> </div> <h4>Code example</h4> <p> Invoke the <code>disable</code> method. </p> <pre><code>$('#jqxRadioButton').jqxRadioButton('disable');</code></pre> <div style="padding-bottom: 5px;"> <em>Try it:</em> <a target="_blank" href="http://jsfiddle.net/jqwidgets/dfJUD/">disables a button in the jqxRadioButton.</a> </div> </div> </td> </tr> <tr> <td class="documentation-option-type-click"> <span id='Span21'>destroy</span> </td> <td> <span>Method</span> </td> <td></td> </tr> <tr> <td colspan='3' style='width: 100%'> <div class="documentation-option-description property-content" style="display: none;"> <p> Destroys the widget. </p> <div class="methodArgs"> <table class="arguments"> <tbody> <tr> <th>Parameter</th> <th>Type</th> <th>Description</th> </tr> <tr> <td><em>None</em></td> <td></td> <td></td> </tr> </tbody> </table> <strong>Return Value</strong><br /> <em>None</em> </div> <h4>Code examples</h4> <p> Invoke the <code>destroy</code>thod. </p> <pre><code>$('#jqxRadioButton').jqxRadioButton('destroy'); </code></pre> <div style="padding-bottom: 5px;"> <em>Try it:</em> <a target="_blank" href="http://jsfiddle.net/jqwidgets/bbzdr/">destroy the jqxRadioButton.</a> </div> </div> </td> </tr> <tr> <td class="documentation-option-type-click"> <span id='Span18'>enable</span> </td> <td> <span>Method</span> </td> <td></td> </tr> <tr> <td colspan='3' style='width: 100%'> <div class="documentation-option-description property-content" style="display: none;"> <p> Enables the radio button. </p> <div class="methodArgs"> <table class="arguments"> <tbody> <tr> <th>Parameter</th> <th>Type</th> <th>Description</th> </tr> <tr> <td><em>None</em></td> <td></td> <td></td> </tr> </tbody> </table> <strong>Return Value</strong><br /> <em>None</em> </div> <h4>Code example</h4> <p> Invoke the <code>enable</code> method. </p> <pre><code>$('#jqxRadioButton').jqxRadioButton('enable');</code></pre> <div style="padding-bottom: 5px;"> <em>Try it:</em> <a target="_blank" href="http://jsfiddle.net/jqwidgets/3ceEN/">enables a button in the jqxRadioButton.</a> </div> </div> </td> </tr> <tr> <td class="documentation-option-type-click"> <span id='Span19'>focus</span> </td> <td> <span>Method</span> </td> <td></td> </tr> <tr> <td colspan='3' style='width: 100%'> <div class="documentation-option-description property-content" style="display: none;"> <p> Focuses the widget. </p> <div class="methodArgs"> <table class="arguments"> <tbody> <tr> <th>Parameter</th> <th>Type</th> <th>Description</th> </tr> <tr> <td><em>None</em></td> <td></td> <td></td> </tr> </tbody> </table> <strong>Return Value</strong><br /> <em>None</em> </div> <h4>Code examples</h4> <p> Invoke the <code>focus</code> method. </p> <pre><code>$('#jqxRadioButton').jqxRadioButton('focus'); </code></pre> <div style="padding-bottom: 5px;"> <em>Try it:</em> <a target="_blank" href="http://jsfiddle.net/jqwidgets/7Fpwv/">focuses the jqxRadioButton.</a> </div> </div> </td> </tr> <tr> <td class="documentation-option-type-click"> <span id='Span20'>render</span> </td> <td> <span>Method</span> </td> <td></td> </tr> <tr> <td colspan='3' style='width: 100%'> <div class="documentation-option-description property-content" style="display: none;"> <p> Renders the widget. </p> <div class="methodArgs"> <table class="arguments"> <tbody> <tr> <th>Parameter</th> <th>Type</th> <th>Description</th> </tr> <tr> <td><em>None</em></td> <td></td> <td></td> </tr> </tbody> </table> <strong>Return Value</strong><br /> <em>None</em> </div> <h4>Code examples</h4> <p> Invoke the <code>render</code> method. </p> <pre><code>$('#jqxRadioButton').jqxRadioButton('render'); </code></pre> <div style="padding-bottom: 5px;"> <em>Try it:</em> <a target="_blank" href="http://jsfiddle.net/jqwidgets/7C2fZ/">renders jqxRadioButton.</a> </div> </div> </td> </tr> <tr> <td class="documentation-option-type-click"> <span id='Span14'>uncheck</span> </td> <td> <span>Method</span> </td> <td></td> </tr> <tr> <td colspan='3' style='width: 100%'> <div class="documentation-option-description property-content" style="display: none;"> <p> Unchecks the radio button. </p> <div class="methodArgs"> <table class="arguments"> <tbody> <tr> <th>Parameter</th> <th>Type</th> <th>Description</th> </tr> <tr> <td><em>None</em></td> <td></td> <td></td> </tr> </tbody> </table> <strong>Return Value</strong><br /> <em>None</em> </div> <h4>Code example</h4> <p> Invoke the <code>uncheck</code> method. </p> <pre><code>$('#jqxRadioButton').jqxRadioButton('uncheck');</code></pre> <div style="padding-bottom: 5px;"> <em>Try it:</em> <a target="_blank" href="http://jsfiddle.net/jqwidgets/NuN75/">unchecks a button in the jqxRadioButton.</a> </div> </div> </td> </tr> <tr> <td class="documentation-option-type-click"> <span id='Span59'>val</span> </td> <td> <span>Method</span> </td> <td></td> </tr> <tr> <td colspan='3' style='width: 100%'> <div class="documentation-option-description property-content" style="display: none;"> <p> Sets or gets the value. </p> <div class="methodArgs"> <table class="arguments"> <tbody> <tr> <th>Parameter</th> <th>Type</th> <th>Description</th> </tr> <tr> <td><em>value(optional)</em></td> <td>Boolean</td> <td></td> </tr> </tbody> </table> <strong>Return Value</strong><br /> <em>Boolean</em> </div> <h4>Code example</h4> <p> Invoke the <code>val</code> method. </p> // Get the value. <pre><code>var value = $("#jqxRadioButton").jqxRadioButton('val');</code></pre> // Get the value using jQuery's val() <pre><code>var value = $("#jqxRadioButton").val();</code></pre> // Set value. <pre><code>$("#jqxRadioButton").jqxRadioButton('val', true);</code></pre> // Set value using jQuery's val(). <pre><code>$("#jqxRadioButton").val(true);</code></pre> <div style="padding-bottom: 5px;"> <em>Try it:</em> <a target="_blank" href="http://jsfiddle.net/jqwidgets/mZ9Ev/">sets a value in the jqxRadioButton.</a> </div> </div> </td> </tr> </table> <br /> </div> </body> </html>