| Issue 243: | jQuery nyromodal + ASP.Net + UpdatePanel/AJAX - endShowContent not working, flickers, loses focus.. | |
| 2 people starred this issue and may be notified of changes. | Back to list |
|
Hi All,
I am using the jQuery nyroModal plugin within ASP.Net. I love nyroModal,
and overall its working very nicely.
But I am using the endShowContent callback to set focus to the first text
input element on the page's content after nyromodal is finished loading. To
achieve this I have the following code on the page that initiates the
nyromodal popup.
$(function() { $.fn.nyroModal.settings.endShowContent = function(elt,
settings) { $('input:text:first', elt.content).focus(); }; });
I can tell its kind of working, because the first text field does
momentarily get focus when the modal appears. But then it kind of flickers
and loses focus again. It's almost as if nyromodal decides it still isn't
fully loaded and something else happens to take the focus back away. Or
perhaps is the UpdatePanel interfering? (I don't know why it would). Is it
likely that the UpdatePanel's bloated auto-generated AJAX JS calls are
doing something after nyromodal's endShowContent call happens?
I don't like ASP.Net because of its bloat and inflexibility and I'm pretty
certain this is another problem that I wouldn't be experiencing if I was
using PHP/Code Ignitor or something where you have complete control of
what's really happening. ASP.Net is the "point and click" programmer's
version of a web development platform. I'm stuck with it for work reasons
from time to time.
Any help or insight appreciated.
May 13, 2009
Project Member
#1
nyro...@gmail.com
May 14, 2009
Hey there, thanks for the prompt reply! I worked out the problem.. I was using an old way to launch nyromodal I'm pretty sure. I just had a hyperlink (a) with class="nyromodal" and target="_blank" which I found on some documentation of forums on the internet somewhere. I've since been pointed in the right direction and realised that I should be calling it via jQuery such as $(a).nyroModal() etc etc. Which is now working great and has resolved all of my problems. Conclusion: Don't initiate nyromodal by using target="_blank" and class="nyromodal", make sure you apply it to any desired links using jQuery only. Thanks a lot for your time. Cheers
May 15, 2009
ok, thanks for your feedback
Status:
Invalid
|
||||||||