Skip to content

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

Closed
FagnerMartinsBrack opened this issue Dec 13, 2012 · 5 comments · Fixed by #106

Comments

@FagnerMartinsBrack
Copy link

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 in Code examples: like:

Code Examples:
Detect if the widget is active on the element:
$( ".selector" ).is( ":data(namespace-widget)" );

@tjvantoll
Copy link
Member

This is likely going to be addressed by jquery/jquery-ui#902.

@scottgonzalez
Copy link
Member

Yup, but for old versions, we should document the selector approach.

@tjvantoll
Copy link
Member

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.

@jzaefferer
Copy link
Member

Once the instance method landed, we also need to update the new Instance section.

@tjvantoll
Copy link
Member

@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.

tjvantoll added a commit to tjvantoll/api.jqueryui.com that referenced this issue Mar 22, 2013
scottgonzalez added a commit that referenced this issue Apr 2, 2013
…ement to determine whether it is a widget. Fixes #77."

This reverts commit cde5d57.
scottgonzalez added a commit that referenced this issue Apr 2, 2013
…n any element to determine whether it is a widget. Fixes #77.""

This reverts commit 404a476.
scottgonzalez added a commit that referenced this issue Nov 27, 2013
…n any element to determine whether it is a widget. Fixes #77.""

This reverts commit 404a476.
scottgonzalez added a commit that referenced this issue Nov 27, 2013
…n any element to determine whether it is a widget. Fixes #77.""

This reverts commit 404a476.
scottgonzalez added a commit that referenced this issue Dec 5, 2013
…n any element to determine whether it is a widget. Fixes #77.""

This reverts commit 404a476.
scottgonzalez added a commit that referenced this issue Dec 12, 2013
…n any element to determine whether it is a widget. Fixes #77.""

This reverts commit 404a476.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants