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
change handling of pw-panel links #176
Comments
And again I came to this issue during development today... Another solution is to do
on every element that is loaded via ajax |
@ryancramerdesign and once again I need to workaround this issue. As our applications get more and more dynamic it is quite a common scenario to have links inside content that is loaded via AJAX. Could you please look into my provided fix?
Or maybe provide a better solution. The point is that links having the Thx! |
Bernhard's fix works fine. Also support for ES6 promises (jQuery's $.when method) is in every evergreen browser, see https://caniuse.com/?search=promises. So I think it would be fine to add this. |
Thx for backing this up @jmartsch |
Short description of the enhancement
pw-panel links are great and I use them very often in my datatables.
The problem with those links is that pwpanels.init() has to be called after the dom elements already exist. On ajax loaded content this is a problem and you would need to trigger init() manually. This is sometimes not so easy and also it can be a performance killer (like here when I have a table with 1000s of rows).
Current vs. suggested behavior
My solution is to intercept clicks on all pw-panel links and add the panel on the fly only for this element. When the panel was added, the link is clicked and the panel opens:
Why would the enhancement be useful to users?
I think this would be useful for any developed plugin or even for all existing pw-panel link occurances. Don't know details about browser support of $.when() but maybe this could be changed to something more foolproof.
Hope that makes sense and was explained good enough :)
The text was updated successfully, but these errors were encountered: