Skip to content

Commit bee024f

Browse files
committed
Widget: Documenting properties. Fixes #85.
1 parent 56c94dc commit bee024f

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

entries/jQuery.widget.xml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,43 @@
8484
</code></pre>
8585

8686
<p>All widgets have a <code>create</code> event which is triggered upon instantiation.</p>
87+
88+
<h3>Properties</h3>
89+
90+
<p>All widgets have the following set of properties:</p>
91+
92+
<ul>
93+
<li>
94+
<strong>document</strong>: The <code>document</code> that the widget's element is within. Useful if you need to interact with widgets within iframes.
95+
</li>
96+
<li>
97+
<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.
98+
</li>
99+
<li>
100+
<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>.
101+
</li>
102+
<li>
103+
<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.
104+
</li>
105+
<li>
106+
<strong>uuid</strong>: A unique, integer identifier for the widget.
107+
</li>
108+
<li>
109+
<strong>version</strong>: The string version of jQuery UI this widget is using.
110+
</li>
111+
<li>
112+
<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>
113+
</li>
114+
<li>
115+
<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>.
116+
</li>
117+
<li>
118+
<strong>widgetName</strong>: The name of the widget. For <code>$.widget( "myNamespace.myWidget", {} )</code>, <code>widgetName</code> will be <code>"myWidget"</code>.
119+
</li>
120+
<li>
121+
<strong>window</strong>: The <code>window</code> that the widget's element is within. Useful if you need to interact with widgets within iframes.
122+
</li>
123+
</ul>
87124
</longdesc>
88125
<category slug="utilities"/>
89126
</entry>

0 commit comments

Comments
 (0)