Skip to content
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

Shown() event not fired for delegated targets #284

Open
Arshad1024 opened this issue Jul 3, 2013 · 14 comments
Open

Shown() event not fired for delegated targets #284

Arshad1024 opened this issue Jul 3, 2013 · 14 comments

Comments

@Arshad1024
Copy link

Hi, first of all thanks a lot for a great plugin. Really helpful.
I've just come across a situation where i need to run a function whenever the dialog and form is shown.
The shown() event works great but while working with delegated targets, the shown event doesn't seems to work for elements added on the fly. I tried adding the shown() event to the fiddle you already had on your site http://jsfiddle.net/xBB5x/1515/
Am i doing it the wrong way? If not is there any fix for this?

@vitalets
Copy link
Owner

vitalets commented Jul 7, 2013

hi, @cr4ken ! You are doing everything right, it's the feature that I totally foggoten.
It was already mentioned in #86 to use trigger instead of triggerHandler to let event be propagated up to parent element.
I will do it in next release and update this issue.
Currently not possible (

@Arshad1024
Copy link
Author

Never mind thanks for clarification :) cheers

@LostCrew
Copy link

hi @vitalets ,

i'd love have this implemented, both for shown and hidden events.
would you like some help developing it?

@vitalets
Copy link
Owner

vitalets commented Aug 4, 2013

hi @LostCrew
l'm a bit overloaded now but pull request are always appreciated )
Exactly for that issue the pitfall is that shown / hidden event names can be used by other widgets (e.g. bootstrap popover) and we can get weird behavior..

@cigaar
Copy link

cigaar commented Sep 24, 2013

+1

@tmorehouse
Copy link

Any chance of using custom event namespaces or custom event names?

@chall8908
Copy link

+1 for event namespaces, would help a lot in instances where event name collisions occur (such as the aforementioned shown).

@tmorehouse
Copy link

Bootstrap (V3 at least, not familiar that much with V2) shown is namespaced, so its easy to filter the bootstrap only events. So for targeting bootstrap's events the event's wont collide (if you use the full event name for the modals), but select2 will get hit twice on shown potentially. I've been tempted to edit a local copy for my use and replace the triggerHandler('shown') statements with trigger('x-editable.shown'), and find any local listeners to use the namespaced version.

@jerimiahmilton
Copy link

This would be a great benefit to have! I will take a look into implementing this myself.

@valieand
Copy link

valieand commented Apr 5, 2014

any progress on this? I deadly need $('body').on('save', '#editable', function(){...}) as I'm developing dynamically updated page. Thanks

@Arshad1024
Copy link
Author

@valieand you can replace triggerHandler with trigger in js, that works.

@valieand
Copy link

valieand commented Apr 6, 2014

@cr4ken - thanks a lot! it works!

@sdishman
Copy link

I've just run up against this bug, and it's preventing me from doing something pretty important for my use case. I know it's been awhile since this was opened, but I figured I would check in and see if there's any update on this issue?

@gordol
Copy link

gordol commented Aug 10, 2017

@sdishman

#86

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

10 participants