-
Notifications
You must be signed in to change notification settings - Fork 75
Widget: Document how to retrieve a widget's instance and how to tell whe... #106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…whether an element has a widget bound to it. Fixes jquery#77.
You could also mention that you can select all elements of a widget using the :data selector, that's usually more useful then the Tough I wonder if we actually want to document this (at least in this detail) if we're going to land that instance method? PS: There are two double spaces in the first p element. |
But wouldn't you still need the |
|
||
<h3>Instance</h3> | ||
|
||
<p>The widget's instance is stored using jQuery core's <a href="http://api.jquery.com/jQuery.data/">data method</a> with the widget's full name as the key. Therefore, you can use the following to retrieve the progressbar widget's instance object from the element.</p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"jQuery core's data method" -> "jQuery.data()"
Yes, you'll still need the I think what users are really looking for though is documentation on each widget page, which can be done with an include. We'll still want these docs for the jQuery.widget entry, of course. |
Updates made. I can tackle adding something to the individual widget's pages next, but for now any concerns landing this? @scottgonzalez @jzaefferer |
$( "#elem" ).data( "ui-progressbar" ); | ||
</code></pre> | ||
|
||
<p>Whether an element has a given widget bound to it can be determined using the <a href="data-selector"><code>:data</code></a> selector.</p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<a href="/data-selector/">
Looks good to me. Just update that href to have the slash. |
...ther an element has a widget bound to it. Fixes #77.
Thoughts on this approach?