-
Notifications
You must be signed in to change notification settings - Fork 75
Document safe way to access the information of an element with a widget bound to it #77
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
Comments
This is likely going to be addressed by jquery/jquery-ui#902. |
Yup, but for old versions, we should document the selector approach. |
A section about this was added in the widget's factory's docs, but we still want something on the individual widget's pages. Reopening this so I remember to do that. |
Once the instance method landed, we also need to update the new Instance section. |
@jzaefferer See #114. I think that pull covers most of this issue. The one thing remaining is we don't have a means of determining whether an element has a given widget bound to it documented on each widget's page as the OP suggested. Currently it's only documented on the widget factory's main API page. |
… determine whether it is a widget. Fixes jquery#77.
As discussed on
http://bugs.jqueryui.com/ticket/8908
,element.is( ":data(namespace-widget)" )
should be documented as a safe way to detect if a widget is being used in a given element.Suggestion 1: It can be written under "Additional Notes" of each component like "Detect if the widget is active on the element:
$( ".selector" ).is( ":data(namespace-widget)" )
"Suggestion 2: It can be written along with the
destroy()
method inCode examples:
like:Code Examples:
Detect if the widget is active on the element:
$( ".selector" ).is( ":data(namespace-widget)" );
The text was updated successfully, but these errors were encountered: