Skip to content

Commit fbda460

Browse files
committed
jQuery.widget: Adding examples for _super() and _superApply().
1 parent baa9750 commit fbda460

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

entries/jQuery.widget.xml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,14 @@ this._off( this.element, "click" );
359359
<desc>
360360
Invokes the method of the same name from the parent widget, with any specified arguments. Essentially <code>.call()</code>.
361361
</desc>
362+
<example>
363+
<desc>Call the parent widget's <code>_setOption()</code> method.</desc>
364+
<code><![CDATA[
365+
_setOption: function( key, value ) {
366+
this._super( key, value );
367+
}
368+
]]></code>
369+
</example>
362370
</method>
363371
<method name="_superApply">
364372
<desc>
@@ -367,6 +375,14 @@ this._off( this.element, "click" );
367375
<argument name="arguments" type="Array">
368376
<desc>Array of arguments to pass to the parent method.</desc>
369377
</argument>
378+
<example>
379+
<desc>Call the parent widget's <code>_setOption()</code> method.</desc>
380+
<code><![CDATA[
381+
_setOption: function( key, value ) {
382+
this._superApply( arguments );
383+
}
384+
]]></code>
385+
</example>
370386
</method>
371387
<method name="_delay" return="Number">
372388
<desc>

0 commit comments

Comments
 (0)