Skip to content

Original select's change event #188

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
amit-goyal opened this issue Nov 8, 2011 · 6 comments
Closed

Original select's change event #188

amit-goyal opened this issue Nov 8, 2011 · 6 comments

Comments

@amit-goyal
Copy link

Is a way to associate the original dropdown's change event to the generated dropdown's value?

I have a piece of code that's targeting the original selectbox's selection which fails to change the generated selectbox's selection.

@fnagel
Copy link
Owner

fnagel commented Nov 8, 2011

No, this is not supported. And even the new, built from scratch version (see #140) will not support that feature. It needs event pulling which is "bad".

Perhaps I could help when you tell me what you want to achieve?

@amit-goyal
Copy link
Author

Agreed, it goes against every fiber of my being but I can't change the script; it's already in production and I don't have the authority to modify it.

Anyway, here's the scenario,

There are four swatches which when clicked select the relative value from the original select box and vice versa. The latter scenario works perfectly fine, the former however, does not.

Now, I can't target the onChange event of the original select boxes because they're autogenerated (I'm targeting select boxes through '#content select'), so I need a generic way to target the original selectbox's change event to bring the selection of the generated selecbox in-sync when one of the swatches is clicked.

i.e.
oSelectBox -> When changed, selects the relative swatch.
A B C D -> When clicked changes the original selectbox.
gSelectBox -> Selects the relative swatch but does not change based on the relative swatch.

Any help would be greatly appreciated.

@fnagel
Copy link
Owner

fnagel commented Nov 24, 2011

Mhh ok, when you HAVE to do it that way why not built a event pulling functionality? Just check the original select via timeout or intervall every 500ms and update the widget with the available methods. Should be no big thing.

@fnagel
Copy link
Owner

fnagel commented Nov 24, 2011

Mhh and when onChange would be suitable why not use $('#content select').change() or $('#content select').bind("change", ?

@fnagel
Copy link
Owner

fnagel commented Dec 7, 2011

Please give some feedback!

@fnagel
Copy link
Owner

fnagel commented Dec 23, 2011

Closed as no feedback was given, please reopen if needed.

@fnagel fnagel closed this as completed Dec 23, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants