Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'widget_properties'

Conflicts:
	entries/jQuery.widget.xml
  • Loading branch information...
commit b4829e5e333572a8b90c2cea22ebbb1d089bc778 2 parents e5566e2 + 4c1b2b3
@tjvantoll tjvantoll authored
Showing with 38 additions and 1 deletion.
  1. +38 −1 entries/jQuery.widget.xml
View
39 entries/jQuery.widget.xml
@@ -23,7 +23,7 @@
<h3>Initialization</h3>
- <p>In order to track the state of the widget, we must introduce a full life cycle for the widget. The life cycle starts when the widget is initalized. To initialize a widget, we simply call the plugin on one or more elements.</p>
+ <p>In order to track the state of the widget, we must introduce a full life cycle for the widget. The life cycle starts when the widget is initialized. To initialize a widget, we simply call the plugin on one or more elements.</p>
<pre><code>
$( "#elem" ).progressbar();
@@ -105,6 +105,43 @@
<pre><code>
$( ":data( 'ui-progressbar' )" );
</code></pre>
+
+ <h3>Properties</h3>
+
+ <p>All widgets have the following set of properties:</p>
+
+ <ul>
+ <li>
+ <strong>document</strong>: The <code>document</code> that the widget's element is within. Useful if you need to interact with widgets within iframes.
+ </li>
+ <li>
+ <strong>element</strong>: A jQuery object containing the element used to instantiate the widget. If you select multiple elements and call <code>.myWidget()</code>, a separate widget instance will be created for each element. Therefore, this property will always contain one element.
+ </li>
+ <li>
+ <strong>namespace</strong>: The location on the global jQuery object that the widget's prototype is stored on. For example a <code>namespace</code> of <code>"ui"</code> indicates that the widget's prototype is stored on <code>$.ui</code>.
+ </li>
+ <li>
+ <strong>options</strong>: An object containing the options currently being used by the widget. On instantiation, any options provided by the user will automatically be merged with any default values defined in <code>$.myNamespace.myWidget.prototype.options</code>. User specified options override the defaults.
+ </li>
+ <li>
+ <strong>uuid</strong>: A unique integer identifier for the widget.
+ </li>
+ <li>
+ <strong>version</strong>: The string version of the widget. For jQuery UI widgets this will be set to the version of jQuery UI the widget is using. Widget developers have to set this property in their prototype explicitly.
+ </li>
+ <li>
+ <strong>widgetEventPrefix</strong>: The prefix prepended to the name of events fired from this widget. For example the <code>widgetEventPrefix</code> of the <a href="/draggable">draggable widget</a> is <code>"drag"</code>, therefore when a draggable is created, the name of the event fired is <code>"dragcreate"</code>. By default the <code>widgetEventPrefix</code> of a widget is its name. <em>Note: This property is deprecated and will be removed in a later release. Event names will be changed to widgetName:eventName (e.g. <code>"draggable:create"</code>.</em>
+ </li>
+ <li>
+ <strong>widgetFullName</strong>: The full name of the widget including the namespace. For <code>$.widget( "myNamespace.myWidget", {} )</code>, <code>widgetFullName</code> will be <code>"myNamespace-myWidget"</code>.
+ </li>
+ <li>
+ <strong>widgetName</strong>: The name of the widget. For <code>$.widget( "myNamespace.myWidget", {} )</code>, <code>widgetName</code> will be <code>"myWidget"</code>.
+ </li>
+ <li>
+ <strong>window</strong>: The <code>window</code> that the widget's element is within. Useful if you need to interact with widgets within iframes.
+ </li>
+ </ul>
</longdesc>
<category slug="utilities"/>
</entry>
Please sign in to comment.
Something went wrong with that request. Please try again.