[TAU] modify mobile component document(progress, toggleswitch)
authorheeju Joo <heeju.joo@samsung.com>
Tue, 16 Jun 2015 08:06:19 +0000 (17:06 +0900)
committerHeeju Joo <heeju.joo@samsung.com>
Wed, 17 Jun 2015 01:23:22 +0000 (10:23 +0900)
Change-Id: I602c4b6f3e915f352339b7c118d641e12a14a643
Signed-off-by: heeju Joo <heeju.joo@samsung.com>
org.tizen.web.apireference/html/ui_fw_api/Mobile_UIComponents/deprecated/mobile_ProgressBar.htm
org.tizen.web.apireference/html/ui_fw_api/Mobile_UIComponents/mobile_Progress.htm
org.tizen.web.apireference/html/ui_fw_api/Mobile_UIComponents/mobile_ToggleSwitch.htm

index a6b9717..0a40f6e 100644 (file)
@@ -20,7 +20,7 @@
                         <th class="note deprecated">Note</th>
                 </tr>
                <tr>
-                       <td class="note deprecated">Since 2.4, Progress Bar component has been a type of <a href="#">Progress</a> component. To get more information about this component, please refer <a href="#">Progress</a> component.</td>
+                       <td class="note deprecated">Since 2.4, Progress Bar component has been a type of <a href="../mobile_Progress.htm">Progress</a> component. To get more information about this component, please refer <a href="../mobile_Progress.htm">Progress</a> component.</td>
                </tr>
                 <tr>
                         <td class="note deprecated">This component has been <span class="deprecated">DEPRECATED since <b>Tizen 2.4</b></span> and will be <i>deleted in Tizen 3.0.</i><br>
index 69d14f7..9bbd787 100644 (file)
 
 <p>The progress component shows that an operation is in progress.</p>
 
+<table class="note">
+       <tbody>
+       <tr>
+               <th class="note">Note</th>
+       </tr>
+       <tr>
+               <td class="note">This component is supported since Tizen 2.4.</td>
+       </tr>
+       <tr>
+               <td class="note"><i>deprecated</i> Progress and ProgressBar component has been merged and renamed to <i>new</i> <strong>Progress.</strong></td>
+       </tr>
+       </tbody>
+</table>
+
+
 <h2>Table of Contents</h2>
 <ol class="toc">
-       
                <li><a href="#default-selectors0.9354383451864123">Default Selectors</a>
 
                </li>
-       
+               <li><a href="#html-examples0.866303835529834">HTML Examples</a>
+
+               </li>
                <li><a href="#manual-constructor0.3267326701898128">Manual Constructor</a>
-                       
+
                </li>
-               <li><a href="#html-examples0.866303835529834">HTML Examples</a>
-                                               </li>   
                <li><a href="#options-for widget0.13800429017283022">Options</a>
 
-       
+               </li>
                <li><a href="#methods0.7043644052464515">Methods</a>
-                       
+
                </li>
-       
-       
 </ol>
 
 <h2><a id="default-selectors0.9354383451864123"></a>Default Selectors</h2>
 
-<p>By default, all elements with the <code>data-role=&quot;progress&quot;</code> attribute are displayed as progress components.</p>
+<p>By default, all elements with the <code>class=&quot;ui-progress&quot;</code> or <code>data-role=&quot;progress&quot;</code> attribute are displayed as progress components.</p>
 
 
+<h2><a id="html-examples0.866303835529834"></a>HTML Examples</h2>
 
-<h2><a id="manual-constructor0.3267326701898128"></a>Manual Constructor</h2>
+<h4>progressbar type</h4>
 
-<p>To manually create a button component, use the component constructor from the <code>tau</code> namespace:</p>
+<pre class="prettyprint">
+&lt;div&nbsp;class=&quot;ui-progress&quot;&nbsp;data-type=&quot;progressbar&quot;&gt;&lt;/div&gt;
+</pre>
 
-<pre class="prettyprint">&lt;div id=&quot;progress&quot;&gt;&lt;/div&gt;
-&lt;script&gt;
-&nbsp;&nbsp;&nbsp;var element = document.getElementById(&quot;progress&quot;),
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;progress = tau.widget.Progress(element);
-&lt;/script&gt;
+<h4>activitybar type</h4>
+
+<pre class="prettyprint">
+&lt;div&nbsp;class=&quot;ui-progress&quot;&nbsp;data-type=&quot;activitybar&quot;&gt;&lt;/div&gt;
 </pre>
 
-<p>The constructor requires an <code>HTMLElement</code> parameter to create the component, and you can get it with the <code>document.getElementById()</code> method. The constructor can also take a second parameter, which is an object defining the configuration options for the component.</p>
+<h4>progresscircle type</h4>
+
+<pre class="prettyprint">
+&lt;div&nbsp;class=&quot;ui-progress&quot;&nbsp;data-type=&quot;progresscircle&quot;&gt;&lt;/div&gt;
+</pre>
 
-<p>If the jQuery library is loaded, you can use its method:</p>
+<h4>activitycircle type</h4>
 
-<pre class="prettyprint">&lt;div id=&quot;progress&quot;&gt;&lt;/div&gt;
-&lt;script&gt;
-&nbsp;&nbsp;&nbsp;$(&quot;#progress&quot;).progress();
-&lt;/script&gt;
+<pre class="prettyprint">
+&lt;div&nbsp;class=&quot;ui-progress&quot;&nbsp;data-type=&quot;activitycircle&quot;&gt;&lt;/div&gt;
 </pre>
 
-<h2><a id="html-examples0.866303835529834"></a>HTML Examples</h2>
 
-<p>To create a simple progress component:</p>
 
-<pre class="prettyprint">&lt;div id=&quot;progress&quot; data-role=&quot;progress&quot;&gt;&lt;/div&gt;
+<h2><a id="manual-constructor0.3267326701898128"></a>Manual Constructor</h2>
+
+<p>To manually create a button component, use the component constructor from the <code>tau</code> namespace:</p>
+
+<pre class="prettyprint">&lt;div&nbsp;id=&quot;progress&quot;&gt;&lt;/div&gt;
+&lt;script&gt;
+&nbsp;&nbsp;&nbsp;var&nbsp;element&nbsp;=&nbsp;document.getElementById(&quot;progress&quot;),
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;progress&nbsp;=&nbsp;tau.widget.Progress(element,&nbsp;{type&nbsp;:&nbsp;&quot;progressbar&quot;});
+&lt;/script&gt;
 </pre>
 
+
 <h2><a id="options-for widget0.13800429017283022"></a>Options</h2>
 
-<p>The options for a component can be defined as <code>data-...</code> attributes or passed as parameters to the constructor.</p>
+<p>The options for a component can be defined as <code>data</code> attributes or passed as parameters to the constructor.</p>
 
 <p>You can change an option for the component using the <code>option</code> method.</p>
 
 
                
                        <tr>
-                               <td class="option"><span style="font-family: Courier New,Courier,monospace">data-running</span></td>
-                               <td class="option">boolean</td>
-                               <td class="option">true</td>
-                               <td class="option">Sets whether the progress component is running.</td>
+                               <td class="option"><span style="font-family: Courier New,Courier,monospace">data-type</span></td>
+                               <td class="option">&quot;progressbar&quot; | &quot;progresscircle&quot; |<br>
+                                       &quot;activitybar&quot; | &quot;activitycircle&quot;</td>
+                               <td class="option">&quot;progressbar&quot;</td>
+                               <td class="option">Sets type of progress component.</td>
                        </tr>
                
                        <tr>
-                               <td class="option"><span style="font-family: Courier New,Courier,monospace">data-style</span></td>
-                               <td class="option">&quot;circle&quot; | &quot;pending&quot;</td>
-                               <td class="option">&quot;pending&quot;</td>
-                               <td class="option"><p>Object with the default options.</p></td>
+                               <td class="option"><span style="font-family: Courier New,Courier,monospace">data-value</span></td>
+                               <td class="option">Number</td>
+                               <td class="option">0</td>
+                               <td class="option">Sets default value or progress component.</td>
                        </tr>
                
                </tbody>
 
 <h2><a id="methods0.7043644052464515"></a>Methods</h2>
 
-<p>To call a method on the component, use one of the existing APIs:</p>
-
-<ul><li><p>TAU API (<strong>RECOMMENDED</strong>):</p>
+<p>To call a method on the component, please refer the following example:</p>
 
 <pre class="prettyprint">&lt;div id=&quot;progress&quot;&gt;&lt;/div&gt;
 &lt;script&gt;
 
 &nbsp;&nbsp;&nbsp;// progress.methodName(argument1, argument2, ...);
 &nbsp;&nbsp;&nbsp;// For example
-&nbsp;&nbsp;&nbsp;progress.show();
-&lt;/script&gt;
-</pre></li>
-
-<li><p>jQuery API (<strong>support for backward compatibility</strong>):</p>
-
-<pre class="prettyprint">&lt;div id=&quot;progress&quot;&gt;&lt;/div&gt;
-&lt;script&gt;
-&nbsp;&nbsp;&nbsp;$(&quot;#progress&quot;).progress();
-
-&nbsp;&nbsp;&nbsp;// $(&quot;.selector&quot;).progress(&quot;methodName&quot;, argument1, argument2, ...);
-&nbsp;&nbsp;&nbsp;// For example
-&nbsp;&nbsp;&nbsp;$(&quot;#progress&quot;).progress(&quot;show&quot;);
+&nbsp;&nbsp;&nbsp;progress.refresh();
 &lt;/script&gt;
 </pre>
-</li></ul>
 
        <h3>Summary</h3>
        <table class="informaltable">
                        
                                <tr>
                                        <td>
-                                               <pre class="intable prettyprint"><a href="#method-hide">hide</a> (  ) </pre>
+                                               <pre class="intable prettyprint"><a href="#method-disable">disable</a> (  ) </pre>
                                        </td>
-                                       <td><p>Hides the component.</p></td>
+                                       <td><p>Disable Progress component.</p></td>
                                </tr>
-                       
-               
-               
-                       
+
                                <tr>
                                        <td>
-                                               <pre class="intable prettyprint">Progress <a href="#method-refresh">refresh</a> (  ) </pre>
+                                               <pre class="intable prettyprint"><a href="#method-enable">enable</a> (  ) </pre>
                                        </td>
-                                       <td><p>Refreshes the progress.</p></td>
+                                       <td><p>Enable Progress component.</p></td>
                                </tr>
-                       
-               
-                       
+
                                <tr>
                                        <td>
-                                               <pre class="intable prettyprint"><a href="#method-running">running</a> ( boolean flag ) </pre>
+                                               <pre class="intable prettyprint"><a href="#method-value">value</a> (  ) </pre>
                                        </td>
-                                       <td><p>Starts or stops running the progress.</p></td>
+                                       <td><p>Sets or gets value of Progress component.</p></td>
                                </tr>
-                       
-               
-                       
+
                                <tr>
                                        <td>
-                                               <pre class="intable prettyprint"><a href="#method-show">show</a> (  ) </pre>
+                                               <pre class="intable prettyprint"><a href="#method-option">option</a> (  ) </pre>
                                        </td>
-                                       <td><p>Shows the component.</p></td>
+                                       <td><p>Sets or gets options of Progress component.</p></td>
                                </tr>
 
+                               <tr>
+                                       <td>
+                                               <pre class="intable prettyprint"><a href="#method-refresh">refresh</a> (  ) </pre>
+                                       </td>
+                                       <td><p>Refreshes the Progress DOM.</p></td>
+                               </tr>
                        
-               
+
                </tbody>
        </table>
        <dl>
-               
 
                                <dt class="method" id="addidp28072"><code><b><span class="methodName"
-                                                                                                                                  id="method-hide">hide</span></b></code></dt>
+                                                                                                                                  id="method-disable">disable</span></b></code></dt>
                                <dd>
                                        <div class="brief">
-                                               <p>Hides the component.</p>
+                                               <p>Disable Progress component.</p>
                                        </div>
                                        <div class="synopsis">
-                                               <pre class="signature prettyprint">hide ( ) </pre>
+                                               <pre class="signature prettyprint">disable ( ) </pre>
                                        </div>
-                                       
                                        <div class="description">
                                                <p>
-                                                       
                                                </p>
                                        </div>
-                                       
-                                       
-                                       
-                                       <div class="returntype">
-                                               <p><span class="return">Return value:</span></p>
-                                               
-                                               
-                                                       No return value
-                                               
-                                       </div>
-                                               <div class="example">
-                                                       <span class="example"><p>Code
-                                                               example (TAU API <strong>RECOMMENDED</strong>):</p><p></p></span>
-                                                       <pre name="code" class="examplecode
-                                                       prettyprint">
-&lt;div id=&quot;progress&quot;&gt;&lt;/div&gt;
-&lt;script&gt;
-&nbsp;&nbsp;&nbsp;var element = document.getElementById(&quot;progress&quot;),
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;progressWidget = tau.widget.Progress(element);
-&nbsp;&nbsp;&nbsp;progressWidget.hide();
-&lt;/script&gt;
-</pre>
-                                               </div>                                  
-                                               <div class="example">
-                                                       <span class="example"><p>Code
-                                                               example (jQuery API <strong>support for backward compatibility</strong>):</p><p></p></span>
-                                                       <pre name="code" class="examplecode
-                                                       prettyprint">
-&lt;div id=&quot;progress&quot;&gt;&lt;/div&gt;
-&lt;script&gt;
-&nbsp;&nbsp;&nbsp;$(&quot;#progress&quot;).progress();
-&nbsp;&nbsp;&nbsp;$(&quot;#progress&quot;).progress(&quot;hide&quot;);
-&lt;/script&gt;
-</pre>
-                                               </div>
-                                       
-                               </dd>
-                       
-               
-                       
-               
-                       
-                               <dt class="method" id="addidp28072"><code><b><span class="methodName"
-                                                                                                                                  id="method-refresh">refresh</span></b></code></dt>
-                               <dd>
-                                       <div class="brief">
-                                               <p>Refreshes the progress.</p>
-                                       </div>
-                                       <div class="synopsis">
-                                               <pre class="signature prettyprint">Progress refresh ( ) </pre>
-                                       </div>
-                                       
-                                       <div class="description">
-                                               <p>
-
-<p>The method rebuilds the DOM structure of the progress component. It must be called after you manually change the HTML attributes of the component&#39;s DOM structure.</p>
 
-<p>The method is called automatically after any component option is changed.</p>
-
-                                               </p>
-                                       </div>
-                                       
-                                       
-                                       
                                        <div class="returntype">
                                                <p><span class="return">Return value:</span></p>
-                                               
-                                                       <table>
-                                                               <tbody>
-                                                               <tr>
-                                                                       <th>Type</th>
-                                                                       <th>Description</th>
-                                                               </tr>
-                                                               <tr>
-                                                                       <td>Progress</td>
-                                                                       <td>Returns this.</td>
-                                                               </tr>
-                                                               </tbody>
-                                                       </table>
-                                               
-                                               
+
+                                               <table>
+                                                       <tbody>
+                                                       <tr>
+                                                               <th>Type</th>
+                                                               <th>Description</th>
+                                                       </tr>
+                                                       <tr>
+                                                               <td>Progress</td>
+                                                               <td>Returns this.</td>
+                                                       </tr>
+                                                       </tbody>
+                                               </table>
                                        </div>
                                                <div class="example">
                                                        <span class="example"><p>Code
-                                                               example (TAU API <strong>RECOMMENDED</strong>):</p><p></p></span>
+                                                               example:</p><p></p></span>
                                                        <pre name="code" class="examplecode
-                                                       prettyprint">
-$(&quot;#progress&quot;).progress();
-&lt;div id=&quot;progress&quot;&gt;&lt;/div&gt;
-&lt;script&gt;
-&nbsp;&nbsp;&nbsp;var element = document.getElementById(&quot;progress&quot;),
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;progressWidget = tau.widget.Progress(element);
-
-&nbsp;&nbsp;&nbsp;progressWidget.refresh();
+                                                       prettyprint">&lt;script&gt;
+&nbsp;&nbsp;&nbsp;var&nbsp;element&nbsp;=&nbsp;document.getElementById(&quot;progress&quot;),
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;progress&nbsp;=&nbsp;tau.widget.Progress(element);
 
-&nbsp;&nbsp;&nbsp;// Is also called after
-&nbsp;&nbsp;&nbsp;progressWidget.option(&quot;running&quot;, true);
-&lt;/script&gt;
-</pre>
-                                               </div>                                  
-                                               <div class="example">
-                                                       <span class="example"><p>Code
-                                                               example (jQuery API <strong>support for backward compatibility</strong>):</p><p></p></span>
-                                                       <pre name="code" class="examplecode
-                                                       prettyprint">
-&lt;div id=&quot;progress&quot;&gt;&lt;/div&gt;
-&lt;script&gt;
-&nbsp;&nbsp;&nbsp;$(&quot;#progress&quot;).progress();
-&nbsp;&nbsp;&nbsp;$(&quot;#progress&quot;).progress(&quot;refresh&quot;);
+&nbsp;&nbsp;&nbsp;progress.disable();
 &lt;/script&gt;
 </pre>
                                                </div>
-                                       
+
                                </dd>
-                       
-               
-                       
-                               <dt class="method" id="addidp28072"><code><b><span class="methodName"
-                                                                                                                                  id="method-running">running</span></b></code></dt>
-                               <dd>
-                                       <div class="brief">
-                                               <p>Starts or stops running the progress.</p>
-                                       </div>
-                                       <div class="synopsis">
-                                               <pre class="signature prettyprint">running ( boolean flag) </pre>
-                                       </div>
-                                       
-                                       <div class="description">
-                                               <p>
-                                                       
-                                               </p>
-                                       </div>
-                                       
-                                       <div class="parameters">
-                                               <p><span class="param">Parameters:</span></p>
-                                       <table>
+
+               <dt class="method" id="addidp28072"><code><b><span class="methodName"
+                                                                                                                  id="method-enable">enable</span></b></code></dt>
+               <dd>
+                       <div class="brief">
+                               <p>Enable Progress component.</p>
+                       </div>
+                       <div class="synopsis">
+                               <pre class="signature prettyprint">enable ( ) </pre>
+                       </div>
+                       <div class="description">
+                               <p>
+                               </p>
+                       </div>
+
+                       <div class="returntype">
+                               <p><span class="return">Return value:</span></p>
+
+                               <table>
                                        <tbody>
                                        <tr>
-                                               <th>Parameter</th>
                                                <th>Type</th>
-                                               <th>Required/optional</th>
-                                               <th>Default value</th>
                                                <th>Description</th>
                                        </tr>
-                                       
-                                       
                                        <tr>
-                                               <td><span style="font-family: Courier New,Courier,monospace">flag</span></td>
-                                               <td>boolean</td>
-                                               <td>Required</td>
-                                               <td></td>
-                                               <td>If <code>true</code>, the progress component is set to run.</td>
+                                               <td>Progress</td>
+                                               <td>Returns this.</td>
                                        </tr>
-                                       
-                                       
                                        </tbody>
-                                       </table>
-                                       </div>
-                                       
-                                       <div class="returntype">
-                                               <p><span class="return">Return value:</span></p>
-                                               No return value
-                                               
-                                               
-                                       </div>
-                                               <div class="example">
-                                                       <span class="example"><p>Code example (TAU API <strong>RECOMMENDED</strong>):</p><p></p></span>
+                               </table>
+                       </div>
+                       <div class="example">
+                                                       <span class="example"><p>Code
+                                                               example:</p><p></p></span>
                                                        <pre name="code" class="examplecode
-                                                       prettyprint">
-&lt;div id=&quot;progress&quot;&gt;&lt;/div&gt;
-&lt;script&gt;
-&nbsp;&nbsp;&nbsp;var element = document.getElementById(&quot;progress&quot;),
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;progressWidget = tau.widget.Progress(element),
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Return current state of running
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;value = progressWidget.running();
+                                                       prettyprint">&lt;script&gt;
+&nbsp;&nbsp;&nbsp;var&nbsp;element&nbsp;=&nbsp;document.getElementById(&quot;progress&quot;),
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;progress&nbsp;=&nbsp;tau.widget.Progress(element);
 
-&nbsp;&nbsp;&nbsp;progressWidget.running(true); // Starts running
-
-&nbsp;&nbsp;&nbsp;progressWidget.running(false); // Stops running
+&nbsp;&nbsp;&nbsp;progress.enable();
 &lt;/script&gt;
 </pre>
-                                               </div>                                  
-                                               <div class="example">
+                       </div>
+
+               </dd>
+
+               <dt class="method" id="addidp28072"><code><b><span class="methodName"
+                                                                                                                  id="method-value">value</span></b></code></dt>
+               <dd>
+                       <div class="brief">
+                               <p>Sets or gets value of Progress component.</p>
+                       </div>
+                       <div class="synopsis">
+                               <pre class="signature prettyprint">value ( Number value ) </pre>
+                       </div>
+                       <div class="description">
+                               <br>
+                                       When this method has no parameter, it returns Progress value.<br>
+                               If you call value with new number, you don't need to call refresh() method because it calls automatically.
+                               </p>
+                       </div>
+
+                       <div class="returntype">
+                               <p><span class="return">Return value:</span></p>
+
+                               <table>
+                                       <tbody>
+                                       <tr>
+                                               <th>Type</th>
+                                               <th>Description</th>
+                                       </tr>
+                                       <tr>
+                                               <td>Number</td>
+                                               <td>Returns value of Progress.</td>
+                                       </tr>
+                                       </tbody>
+                               </table>
+                       </div>
+                       <div class="example">
                                                        <span class="example"><p>Code
-                                                               example (jQuery API <strong>support for backward compatibility</strong>):</p><p></p></span>
+                                                               example:</p><p></p></span>
                                                        <pre name="code" class="examplecode
-                                                       prettyprint">
-&lt;div id=&quot;progress&quot;&gt;&lt;/div&gt;
-&lt;script&gt;
-&nbsp;&nbsp;&nbsp;$(&quot;#progress&quot;).progress();
+                                                       prettyprint">&lt;script&gt;
+&nbsp;&nbsp;&nbsp;var&nbsp;element&nbsp;=&nbsp;document.getElementById(&quot;progress&quot;),
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;progress&nbsp;=&nbsp;tau.widget.Progress(element),
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;originValue;
 
-&nbsp;&nbsp;&nbsp;// Return current state of running
-&nbsp;&nbsp;&nbsp;$(&quot;#progress&quot;).progress(&quot;running&quot;);
+&nbsp;&nbsp;&nbsp;// Get the origin value of progress
+&nbsp;&nbsp;&nbsp;originValue = progress.value();
+&nbsp;&nbsp;&nbsp;console.log(originValue);
 
-&nbsp;&nbsp;&nbsp;// Starts running
-&nbsp;&nbsp;&nbsp;$(&quot;#progress&quot;).progress(&quot;running&quot;, true);
-
-&nbsp;&nbsp;&nbsp;// Stops running
-&nbsp;&nbsp;&nbsp;$(&quot;#progress&quot;).progress(&quot;running&quot;, false);
+&nbsp;&nbsp;&nbsp;// sets the value of progress to 70
+&nbsp;&nbsp;&nbsp;progress.value(70);
 &lt;/script&gt;
 </pre>
-                                               </div>
-                                       
-                               </dd>
-                       
-               
-                       
-                               <dt class="method" id="addidp28072"><code><b><span class="methodName"
-                                                                                                                                  id="method-show">show</span></b></code></dt>
-                               <dd>
-                                       <div class="brief">
-                                               <p>Shows the component.</p>
-                                       </div>
-                                       <div class="synopsis">
-                                               <pre class="signature prettyprint">show ( ) </pre>
-                                       </div>
-                                       
-                                       <div class="description">
-                                               <p>
-                                                       
-                                               </p>
-                                       </div>
-                                       
-                                       
-                                       
-                                       <div class="returntype">
-                                               <p><span class="return">Return value:</span></p>
-                                               
-                                               
-                                                       No return value
-                                               
-                                       </div>
-                                               <div class="example">
+                       </div>
+
+               </dd>
+
+               <dt class="method" id="addidp28072"><code><b><span class="methodName"
+                                                                                                                  id="method-option">option</span></b></code></dt>
+               <dd>
+                       <div class="brief">
+                               <p>Sets or gets options of Progress component.</p>
+                       </div>
+                       <div class="synopsis">
+                               <pre class="signature prettyprint">option ( ) </pre>
+                       </div>
+                       <div class="description">
+                               <p>
+                                       When changing value option of progress, we recommend to use value() method.
+                               </p>
+                       </div>
+
+                       <div class="example">
                                                        <span class="example"><p>Code
-                                                               example (TAU API <strong>RECOMMENDED</strong>):</p><p></p></span>
+                                                               example:</p><p></p></span>
                                                        <pre name="code" class="examplecode
-                                                       prettyprint">
-&lt;div id=&quot;progress&quot;&gt;&lt;/div&gt;
-&lt;script&gt;
-&nbsp;&nbsp;&nbsp;var element = document.getElementById(&quot;progress&quot;),
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;progressWidget = tau.widget.Progress(element);
-
-&nbsp;&nbsp;&nbsp;progressWidget.show();
+                                                       prettyprint">&lt;script&gt;
+&nbsp;&nbsp;&nbsp;var&nbsp;element&nbsp;=&nbsp;document.getElementById(&quot;progress&quot;),
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;progress&nbsp;=&nbsp;tau.widget.Progress(element),
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;type;
+
+&nbsp;&nbsp;&nbsp;progress.option("value", 50);
+&nbsp;&nbsp;&nbsp;// After change option, please call refresh method.
+&nbsp;&nbsp;&nbsp;progress.refresh();
+
+&nbsp;&nbsp;&nbsp;// Gets type option value
+&nbsp;&nbsp;&nbsp;type = progress.option("type");
+&nbsp;&nbsp;&nbsp;console.log(type);
 &lt;/script&gt;
 </pre>
-                                               </div>                                  
-                                               <div class="example">
+                       </div>
+
+               </dd>
+
+               <dt class="method" id="addidp28072"><code><b><span class="methodName"
+                                                                                                                  id="method-refresh">refresh</span></b></code></dt>
+               <dd>
+                       <div class="brief">
+                               <p>Refresh Progress DOM.</p>
+                       </div>
+                       <div class="synopsis">
+                               <pre class="signature prettyprint">refresh ( ) </pre>
+                       </div>
+                       <div class="description">
+                               <p>
+                               </p>
+                       </div>
+
+                       <div class="example">
                                                        <span class="example"><p>Code
-                                                               example (jQuery API <strong>support for backward compatibility</strong>):</p><p></p></span>
+                                                               example:</p><p></p></span>
                                                        <pre name="code" class="examplecode
-                                                       prettyprint">
-&lt;div id=&quot;progress&quot;&gt;&lt;/div&gt;
-&lt;script&gt;
-&nbsp;&nbsp;&nbsp;$(&quot;#progress&quot;).progress();
-&nbsp;&nbsp;&nbsp;$(&quot;#progress&quot;).progress(&quot;show&quot;);
+                                                       prettyprint">&lt;script&gt;
+&nbsp;&nbsp;&nbsp;var&nbsp;element&nbsp;=&nbsp;document.getElementById(&quot;progress&quot;),
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;progress&nbsp;=&nbsp;tau.widget.Progress(element);
+
+&nbsp;&nbsp;&nbsp;// Change DOM dynamically or change option
+&nbsp;&nbsp;&nbsp;progress.refresh();
 &lt;/script&gt;
 </pre>
-                                               </div>
-                                       
-                               </dd>
-                       
-               
-               
+                       </div>
+
+               </dd>
+
+
        </dl>
 
 
index 0038f54..30369fa 100644 (file)
 
 <h1>Toggle Switch</h1>
 
-<p>The flip toggle switch component is a common UI element on mobile devices, used for binary on/off or true/false data input.</p>
+<p>The ToggleSwitch component is used as 2-state switch for on/off or true/false data input.</p>
 
-<p>The flip toggle switch component shows a 2-state switch on the screen. If defined with a <code>select</code> element type with <code>option</code> element, the toggles can have labels. You can drag or flip the handle, or tap one side of the switch.</p>
-
-<p>Toggles defined with the <code>select</code> element are supported for backward compatibility.</p>
 
 <h2>Table of Contents</h2>
 <ol class="toc">
                <li><a href="#default-selectors">Default Selectors</a>
                        
                </li>
-       
-               <li><a href="#manual-constructor">Manual Constructor</a>
-                       
-               </li>
 
+               <li><a href="#html-examples">HTML Example</a>
+
+               </li>
        
-               <li><a href="#options-list">Options</a>
+               <li><a href="#manual-constructor">Manual Constructor</a>
                        
                </li>
        
 
 <h2><a id="default-selectors"></a>Default Selectors</h2>
 
-<p>By default, all <code>input</code> elements with the <code>data-role=&quot;toggleswitch&quot;</code> attribute or the <code>select</code> elements with the <code>data-role=&quot;slider&quot;</code> or <code>data-role=&quot;toggleswitch&quot;</code> attribute are displayed as toggle switches.</p>
-
-<p>To add a toggle switch component to the application:</p>
-
+<p>By default, all <code>input</code> elements with the <code>class=&quot;ui-toggleswitch&quot;</code> or <code>data-role=&quot;toggleswitch&quot;</code> are displayed as toggle switches.
+<br>Additionally, <code>select</code> elements with the <code>class=&quot;ui-toggleswitch&quot;</code> or <code>data-role=&quot;toggleswitch&quot;</code> are also displayed as toggle switches.</br>
+
+<p>We recommend to use <code>input</code> selectors for toggle switch.</p>
+
+<table class="note deprecated">
+       <tbody>
+       <tr>
+               <th class="note deprecated">Note</th>
+       </tr>
+       <tr>
+               <td class="note deprecated">selector with <span style="font-family: Courier New,Courier,monospace">select[data-role=&quot;slider&quot;]</span> has been <span class="deprecated">DEPRECATED since <b>Tizen 2.4</b></span>.</i><br>
+                       To support Backward compitablity, please import tau.support-2.3.js.</td>
+       </tr>
+       </tbody>
+</table>
+
+<h2><a id="html-examples"></a>HTML Examples</h2>
+<p>Following example shows how to create toggle switch in multiple way:</p>
+<h4>ToggleSwitch with input tag</h4>
 <pre class="prettyprint">
-&lt;input type=&quot;checkbox&quot; data-role=&quot;toggleswitch&quot;&gt;
-
-&lt;input type=&quot;checkbox&quot; id=&quot;checkbox-1&quot; data-role=&quot;toggleswitch&quot;/&gt;
-&lt;label for=&quot;checkbox-1&quot;&gt;&lt;/label&gt;
+&lt;input&nbsp;type=&quot;checkbox&quot;&nbsp;name=&quot;toggle-1&quot;&nbsp;id=&quot;toggle-1&quot;&nbsp;class=&quot;ui-toggleswitch&quot;/&gt;
 
-&lt;select name=&quot;flip-11&quot; id=&quot;flip-11&quot; data-role=&quot;slider&quot;&gt;
-&nbsp;&nbsp;&nbsp;&lt;option value=&quot;off&quot;&gt;&lt;/option&gt;
-&nbsp;&nbsp;&nbsp;&lt;option value=&quot;on&quot;&gt;&lt;/option&gt;
-&lt;/select&gt;
-
-&lt;select name=&quot;flip-11&quot; id=&quot;flip-11&quot; data-role=&quot;toggleswitch&quot;&gt;
-&nbsp;&nbsp;&nbsp;&lt;option value=&quot;off&quot;&gt;&lt;/option&gt;
-&nbsp;&nbsp;&nbsp;&lt;option value=&quot;on&quot;&gt;&lt;/option&gt;
-&lt;/select&gt;
-
-&lt;select name=&quot;flip-11&quot; id=&quot;flip-11&quot; data-role=&quot;toggleswitch&quot;&gt;
-&nbsp;&nbsp;&nbsp;&lt;option value=&quot;off&quot;&gt;off option&lt;/option&gt;
-&nbsp;&nbsp;&nbsp;&lt;option value=&quot;on&quot;&gt;on option&lt;/option&gt;
+&lt;!--&nbsp;disabled&nbsp;toggle&nbsp;switch&nbsp;--&gt;
+&lt;input&nbsp;type=&quot;checkbox&quot;&nbsp;name=&quot;toggle-2&quot;&nbsp;id=&quot;toggle-2&quot;&nbsp;class=&quot;ui-toggleswitch&quot;&nbsp;disabled/&gt;
+</pre>
+<h4>ToggleSwitch with select tag</h4>
+<pre class="prettyprint">
+&lt;select&nbsp;name=&quot;flip-1&quot;&nbsp;id=&quot;flip-1&quot;&nbsp;class=&quot;ui-toggleswitch&quot;&gt;
+&nbsp;&nbsp;&nbsp;&lt;option&nbsp;value=&quot;off&quot;&gt;&lt;/option&gt;
+&nbsp;&nbsp;&nbsp;&lt;option&nbsp;value=&quot;on&quot;&gt;&lt;/option&gt;
 &lt;/select&gt;
 </pre>
 
+
 <h2><a id="manual-constructor"></a>Manual Constructor</h2>
 
 <p>To manually create a toggle switch component, use the component constructor from the <strong>tau</strong> namespace:</p>
 
 <pre class="prettyprint">
-&lt;select id=&quot;toggle&quot; name=&quot;flip-11&quot; id=&quot;flip-11&quot; data-role=&quot;toggleswitch&quot; data-mini=&quot;true&quot;&gt;
-&nbsp;&nbsp;&nbsp;&lt;option value=&quot;off&quot;&gt;&lt;/option&gt;
-&nbsp;&nbsp;&nbsp;&lt;option value=&quot;on&quot;&gt;&lt;/option&gt;
-&lt;/select&gt;
+&lt;input&nbsp;type=&quot;checkbox&quot;&nbsp;name=&quot;toggle-1&quot;&nbsp;id=&quot;toggle-1&quot;&nbsp;class=&quot;ui-toggleswitch&quot;/&gt;
+
 &lt;script&gt;
-&nbsp;&nbsp;&nbsp;var toggleElement = document.getElementById(&quot;toggle&quot;),
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;toggle = tau.widget.ToggleSwitch(toggleElement);
+   var&nbsp;toggleComponent&nbsp;=&nbsp;tau.widget.ToggleSwitch(document.getElementById(&quot;toggle-1&quot;));
 &lt;/script&gt;
 </pre>
 
-
-       <h2><a id="options-list"></a>Options</h2>
-
-<p>The following table lists the options for the toggle switch component.</p>
-       <table>
-               <tbody>
-               <tr>
-                       <th>Option</th>
-                       <th>Input type</th>
-                       <th>Default value</th>
-                       <th>Description</th>
-               </tr>
-               
-                       
-                       <tr>
-                               <td class="option"><span style="font-family: Courier New,Courier,monospace">data-disabled</span></td>
-                               <td class="option">boolean</td>
-                               <td class="option">false</td>
-                               <td class="option">Starts the component as enabled or disabled.</td>
-                       </tr>
-               
-                       <tr>
-                               <td class="option"><span style="font-family: Courier New,Courier,monospace">data-highlight</span></td>
-                               <td class="option">boolean</td>
-                               <td class="option">true</td>
-                               <td class="option">If set, the toggle switch can be highlighted.</td>
-                       </tr>
-               
-                       <tr>
-                               <td class="option"><span style="font-family: Courier New,Courier,monospace">data-inline</span></td>
-                               <td class="option">boolean | null</td>
-                               <td class="option">false</td>
-                               <td class="option">If the value is <code>&quot;true&quot;</code>, the toggle switch has a css property.</td>
-                       </tr>
-               
-                       <tr>
-                               <td class="option"><span style="font-family: Courier New,Courier,monospace">data-mini</span></td>
-                               <td class="option">boolean | null</td>
-                               <td class="option">false</td>
-                               <td class="option">Sets the size of the toggle switch.</td>
-                       </tr>
-               
-               
-               </tbody>
-       </table>
-
-
-
        <h2><a id="methods-list"></a>Methods</h2>
 
        <h3>Summary</h3>
                        
                                <tr>
                                        <td>
-                                               <pre class="intable prettyprint">ToggleSwitch <a href="#method-disable">disable</a> (  ) </pre>
+                                               <pre class="intable prettyprint"><a href="#method-disable">disable</a> (  ) </pre>
                                        </td>
                                        <td><p>Disables the toggle switch.</p></td>
                                </tr>           
                                
                                <tr>
                                        <td>
-                                               <pre class="intable prettyprint">ToggleSwitch <a href="#method-enable">enable</a> (  ) </pre>
+                                               <pre class="intable prettyprint"><a href="#method-enable">enable</a> (  ) </pre>
                                        </td>
                                        <td><p>Enables the toggle switch.</p></td>
                                </tr>
-                       
-                               <tr>
-                                       <td>
-                                               <pre class="intable prettyprint">ToggleSwitch <a href="#method-refresh">refresh</a> (  ) </pre>
-                                       </td>
-                                       <td><p>Refreshes a toggle switch markup.</p></td>
-                               </tr>
-                       
+
                                <tr>
                                        <td>
-                                               <pre class="intable prettyprint">string <a href="#method-value">value</a> (  ) </pre>
+                                               <pre class="intable prettyprint"><a href="#method-value">value</a> (  ) </pre>
                                        </td>
-                                       <td><p>Gets or sets a value.</p></td>
+                                       <td><p>Gets toggleswitch state value.</p></td>
                                </tr>                   
                
                </tbody>
                                        
                                                <div class="example">
                                                        <span class="example"><p>Code
-                                                               example (TAU API <strong>RECOMMENDED</strong>):</p><p></p></span>
+                                                               example:</p><p></p></span>
                                                        <pre name="code" class="examplecode
                                                        prettyprint">
-&lt;select id=&quot;flip-11&quot; name=&quot;flip-11&quot; data-role=&quot;toggleswitch&quot;&gt;
-&nbsp;&nbsp;&nbsp;&lt;option value=&quot;off&quot;&gt;&lt;/option&gt;
-&nbsp;&nbsp;&nbsp;&lt;option value=&quot;on&quot;&gt;&lt;/option&gt;
+&lt;select&nbsp;name=&quot;flip-1&quot;&nbsp;id=&quot;flip-1&quot;&nbsp;class=&quot;ui-toggleswitch&quot;&gt;
+&nbsp;&nbsp;&nbsp;&lt;option&nbsp;value=&quot;off&quot;&gt;&lt;/option&gt;
+&nbsp;&nbsp;&nbsp;&lt;option&nbsp;value=&quot;on&quot;&gt;&lt;/option&gt;
 &lt;/select&gt;
 &lt;script&gt;
 &nbsp;&nbsp;&nbsp;var toggle = document.getElementById(&quot;flip-11&quot;),
 </pre>
                                                </div>
                                        
-                                               <div class="example">
-                                                       <span class="example"><p>Code
-                                                               example (jQuery API <strong>support for backward compatibility</strong>):</p></span>
-                                                       <pre name="code" class="examplecode
-                                                       prettyprint">
-&lt;select id=&quot;flip-11&quot; name=&quot;flip-11&quot; data-role=&quot;toggleswitch&quot;&gt;
-&nbsp;&nbsp;&nbsp;&lt;option value=&quot;off&quot;&gt;&lt;/option&gt;
-&nbsp;&nbsp;&nbsp;&lt;option value=&quot;on&quot;&gt;&lt;/option&gt;
-&lt;/select&gt;
-&lt;script&gt;
-&nbsp;&nbsp;&nbsp;$(&quot;#flip-11&quot;).toggleswitch(&quot;disable&quot;);
-&lt;/script&gt;
-</pre>
-                                               </div>
+
                                        
                                </dd>           
                
                                        
                                                <div class="example">
                                                        <span class="example"><p>Code
-                                                               example (TAU API <strong>RECOMMENDED</strong>):</p><p></p></span>
+                                                               example:</p><p></p></span>
                                                        <pre name="code" class="examplecode
                                                        prettyprint">
-&lt;select id=&quot;flip-11&quot; name=&quot;flip-11&quot; data-role=&quot;toggleswitch&quot;&gt;
-&nbsp;&nbsp;&nbsp;&lt;option value=&quot;off&quot;&gt;&lt;/option&gt;
-&nbsp;&nbsp;&nbsp;&lt;option value=&quot;on&quot;&gt;&lt;/option&gt;
+&lt;select&nbsp;name=&quot;flip-1&quot;&nbsp;id=&quot;flip-1&quot;&nbsp;class=&quot;ui-toggleswitch&quot;&gt;
+&nbsp;&nbsp;&nbsp;&lt;option&nbsp;value=&quot;off&quot;&gt;&lt;/option&gt;
+&nbsp;&nbsp;&nbsp;&lt;option&nbsp;value=&quot;on&quot;&gt;&lt;/option&gt;
 &lt;/select&gt;
 &lt;script&gt;
 &nbsp;&nbsp;&nbsp;var toggle = document.getElementById(&quot;flip-11&quot;),
 </pre>
                                                </div>
                                        
-                                               <div class="example">
-                                                       <span class="example"><p>Code
-                                                               example (jQuery API <strong>support for backward compatibility</strong>):</p></span>
-                                                       <pre name="code" class="examplecode
-                                                       prettyprint">
-&lt;select id=&quot;flip-11&quot; name=&quot;flip-11&quot; data-role=&quot;toggleswitch&quot;&gt;
-&nbsp;&nbsp;&nbsp;&lt;option value=&quot;off&quot;&gt;&lt;/option&gt;
-&nbsp;&nbsp;&nbsp;&lt;option value=&quot;on&quot;&gt;&lt;/option&gt;
-&lt;/select&gt;
-&lt;script&gt;
-&nbsp;&nbsp;&nbsp;$(&quot;#flip-11&quot;).toggleswitch(&quot;enable&quot;);
-&lt;/script&gt;
-</pre>
-                                               </div>
-                                       
                                </dd>
-                       
-               
-                       <dt class="method"><code><b><span class="methodName"
-                                                                                                                                  id="method-refresh">refresh</span></b></code></dt>
-                               <dd>
-                                       <div class="brief">
-                                               <p>Refreshes a toggle switch markup.</p>
-                                       </div>
-                                       <div class="synopsis">
-                                               <pre class="signature prettyprint">ToggleSwitch refresh ( ) </pre>
-                                       </div>
-                                       
-                                       <div class="description">
-                                               <p>
-                                                       <p>The method rebuilds the DOM structure of the toggle switch component. It must be called after you manually change the HTML attributes of component&#39;s DOM structure.</p>
-
-<p>The method is called automatically after any component option is changed.</p>
-
-
-
-
-                                               </p>
-                                       </div>
-                                       
-                                       
-                                       
-                                       <div class="returntype">
-                                               <p><span class="return">Return value:</span></p>
-                                               
-                                                       <table>
-                                                               <tbody>
-                                                               <tr>
-                                                                       <th>Type</th>
-                                                                       <th>Description</th>
-                                                               </tr>
-                                                               <tr>
-                                                                       <td>ToggleSwitch</td>
-                                                                       <td>Return this.</td>
-                                                               </tr>
-                                                               </tbody>
-                                                       </table>
-                                               
-                                               
-                                       </div>
-                                       
-                                               <div class="example">
-                                                       <span class="example"><p>Code
-                                                               example (TAU API <strong>RECOMMENDED</strong>):</p><p></p></span>
-                                                       <pre name="code" class="examplecode
-                                                       prettyprint">
-&lt;select id=&quot;flip-11&quot; name=&quot;flip-11&quot; data-role=&quot;toggleswitch&quot;&gt;
-&nbsp;&nbsp;&nbsp;&lt;option value=&quot;off&quot;&gt;&lt;/option&gt;
-&nbsp;&nbsp;&nbsp;&lt;option value=&quot;on&quot;&gt;&lt;/option&gt;
-&lt;/select&gt;
-&lt;script&gt;
-&nbsp;&nbsp;&nbsp;var toggle = document.getElementById(&quot;flip-11&quot;),
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;toggleWidget = tau.widget.ToggleSwitch(toggle),
-&nbsp;&nbsp;&nbsp;toggleWidget.refresh();
-&lt;/script&gt;
-</pre>
-                                               </div>
-                                       
-                                               <div class="example">
-                                                       <span class="example"><p>Code
-                                                               example (jQuery API <strong>support for backward compatibility</strong>):</p></span>
-                                                       <pre name="code" class="examplecode
-                                                       prettyprint">
-&lt;select id=&quot;flip-11&quot; name=&quot;flip-11&quot; data-role=&quot;toggleswitch&quot;&gt;
-&nbsp;&nbsp;&nbsp;&lt;option value=&quot;off&quot;&gt;&lt;/option&gt;
-&nbsp;&nbsp;&nbsp;&lt;option value=&quot;on&quot;&gt;&lt;/option&gt;
-&lt;/select&gt;
-&lt;script&gt;
-&nbsp;&nbsp;&nbsp;$(&quot;#flip-11&quot;).toggleswitch(&quot;refresh&quot;);
-&lt;/script&gt;
-</pre>
-                                               </div>
-                                       
-                               </dd>
-                       
-               
 
                                                        
                                <dt class="method"><code><b><span class="methodName"
                                                                                                                                   id="method-value">value</span></b></code></dt>
                                <dd>
                                        <div class="brief">
-                                               <p>Gets or sets a value.</p>
+                                               <p>Gets a value of toggle switch.</p>
                                        </div>
                                        <div class="synopsis">
-                                               <pre class="signature prettyprint">string value ( ) </pre>
+                                               <pre class="signature prettyprint">Number value ( ) </pre>
                                        </div>
                                        
                                                <p><span class="version">Since: </span>
                                        
                                        <div class="description">
                                                <p>
-                                                       <p>This method returns the element value or sets the element value.</p>
+                                                       <p>This method returns the element value. For ToggleSwitch, when toggle switch has 'on' state, it returns 1. Otherwise, it returns 0.</p>
 
 
 
                                                                        <th>Description</th>
                                                                </tr>
                                                                <tr>
-                                                                       <td>string</td>
-                                                                       <td>In the get mode, returns the element value or element.</td>
+                                                                       <td>Number</td>
+                                                                       <td>Returns the value (0 or 1) of element.</td>
                                                                </tr>
                                                                </tbody>
                                                        </table>
                                        
                                                <div class="example">
                                                        <span class="example"><p>Code
-                                                               example (TAU API <strong>RECOMMENDED</strong>):</p><p></p></span>
+                                                               example:</p><p></p></span>
                                                        <pre name="code" class="examplecode
                                                        prettyprint">
-&lt;select id=&quot;flip-11&quot; name=&quot;flip-11&quot; data-role=&quot;toggleswitch&quot;&gt;
-&nbsp;&nbsp;&nbsp;&lt;option value=&quot;off&quot;&gt;&lt;/option&gt;
-&nbsp;&nbsp;&nbsp;&lt;option value=&quot;on&quot;&gt;&lt;/option&gt;
+&lt;select&nbsp;name=&quot;flip-1&quot;&nbsp;id=&quot;flip-1&quot;&nbsp;class=&quot;ui-toggleswitch&quot;&gt;
+&nbsp;&nbsp;&nbsp;&lt;option&nbsp;value=&quot;off&quot;&gt;&lt;/option&gt;
+&nbsp;&nbsp;&nbsp;&lt;option&nbsp;value=&quot;on&quot;&gt;&lt;/option&gt;
 &lt;/select&gt;
 &lt;script&gt;
 &nbsp;&nbsp;&nbsp;var toggle = document.getElementById(&quot;flip-11&quot;),
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;toggleWidget = tau.widget.ToggleSwitch(toggle),
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Value contains the index of the select element
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;value = toggleWidget.value();
-&nbsp;&nbsp;&nbsp;// Sets the index for the toggle
-&nbsp;&nbsp;&nbsp;toggleWidget.value(&quot;1&quot;);
-&lt;/script&gt;
-</pre>
-                                               </div>
-                                       
-                                               <div class="example">
-                                                       <span class="example"><p>Code
-                                                               example (jQuery API <strong>support for backward compatibility</strong>):</p></span>
-                                                       <pre name="code" class="examplecode
-                                                       prettyprint">
-&lt;select id=&quot;flip-11&quot; name=&quot;flip-11&quot; data-role=&quot;toggleswitch&quot;&gt;
-&nbsp;&nbsp;&nbsp;&lt;option value=&quot;off&quot;&gt;&lt;/option&gt;
-&nbsp;&nbsp;&nbsp;&lt;option value=&quot;on&quot;&gt;&lt;/option&gt;
-&lt;/select&gt;
-&lt;script&gt;
-&nbsp;&nbsp;&nbsp;// Value contains the index of the select element
-&nbsp;&nbsp;&nbsp;$(&quot;#flip-11&quot;).toggleswitch(&quot;value&quot;);
-&nbsp;&nbsp;&nbsp;// Sets the index for the toggle
-&nbsp;&nbsp;&nbsp;$(&quot;#flip-11&quot;).toggleswitch(&quot;value&quot;, &quot;1&quot;);
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;toggleState = toggleWidget.value();
+&nbsp;&nbsp;&nbsp;console.log(toggleState);
 &lt;/script&gt;
 </pre>
                                                </div>