| Issue 311: | Creating a new modal at each call | |
| 2 people starred this issue and may be notified of changes. | Back to list |
|
What steps will reproduce the problem? 1. Using nyromodal with the Ajax method + a call to $.nyroModalSettings() (changing the width of the modal window) What is the expected output? What do you see instead? Creating a new modal window each time there is a click on the link. The callback description shows that if the modal window already exists, this one is re-used. My modal window is calling a aspx page, and that way of doing it prevents the page_load() method of the aspx page from being called - thing I don't want to happen. Any way to force a new creation each time there is a click on the link ? Thx
Aug 17, 2009
Project Member
#1
nyro...@gmail.com
Aug 17, 2009
The thing is that if there is any change on my aspx page (linked with a database) between two calls to the modal, I won't see it. Indeed, the modal re-opens with the same information that was displayed the first time I opened it (I can clearly see it since it the page_load() method of my page isn't called).
Aug 17, 2009
Did you check if the Ajax call is actually made against the server? Could you send me a link where I can see it please? And which browser are you testing?
Aug 17, 2009
To sum up, I've got in my main page:
<a id="Link" class="nyroModal" rev="modal" href="myaspxpage.aspx"><img
src='Images/edit.png' ></a>
plus some javascript code:
<script type="text/javascript">
$(function() {
$.nyroModalSettings({
width: '750'
});
});
</script>
in my aspx page, let's say there is a string depending on a value stored in a
database. The first try works well, the ajax call is made, data is shown. If I close
the modal, change the value stored in the DB and try again, the same page is
displayed, with the old value, as if everything was cached (afaik i can't see any
ajax call made that time).
i'm testing on FF 3.5 & IE6. Same result both the browsers.
Anyway, don't spend too much time on this, it's not a kind of bug, I just wanted to
know if there was a way to initialize the modal each time one clicked on the link.
Thx for your answers
Aug 17, 2009
Could you just try something, to know if it's a nyroModal bug or something else.
on a test page with jQuery loaded:
<script type="text/javascript">
$(function() {
$('#test').click(function(e) {
e.preventDefault();
$.ajax({
url: this.href,
success: function (data, textStatus) {
alert(data);
}
});
});
});
</script>
<a href="#test" href="myaspxpage.aspx">Test Link</a>
And doing the same test that you did:
1) load the test page and click on the link to check what's on the alert
2) change you DB value
3) test again and check the value in the alert.
Aug 17, 2009
Tried this, I've got the exact same value in the alert before and after updating the DB. As I said, your plugin is working very fine in all the other test cases i tried. Trying to call an aspx page from a hyperlink placed in a datagrid seems a little bit too much ;-) I'll try using nyromodal another way, with inline content maybe. Anyway, thx a lot for the help !
Aug 17, 2009
It seems that the content is cached by jQuery.
In order to solve that, you could set the cache setting to false.
To use it with nyroModal, just do it like:
$.nyroModalSettings({
ajax: {
cache: false
}
});
Aug 22, 2009
(No comment was entered for this change.)
Status:
Invalid
|
||||||||