Skip to content

Commit 8245cc7

Browse files
committed
jQuery.widget: Adding a code example for destroy().
1 parent 6817f59 commit 8245cc7

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

entries/jQuery.widget.xml

+16-1
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,22 @@
176176
<xi:include href="../includes/widget-option-show.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
177177
</options>
178178
<methods suppress-auto-examples="true">
179-
<xi:include href="../includes/widget-method-destroy.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
179+
<method name="destroy">
180+
<desc>
181+
Removes the <placeholder name="name"/> functionality completely. This will return the element back to its pre-init state.
182+
</desc>
183+
<example>
184+
<desc>Destroy the widget when any of its anchors are clicked.</desc>
185+
<code><![CDATA[
186+
this._on( this.element, {
187+
"click a": function( event ) {
188+
event.preventDefault();
189+
this.destroy();
190+
}
191+
});
192+
]]></code>
193+
</example>
194+
</method>
180195
<xi:include href="../includes/widget-method-disable.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
181196
<xi:include href="../includes/widget-method-enable.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
182197
<xi:include href="../includes/widget-method-option.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>

0 commit comments

Comments
 (0)