[jQuery] jqModal and dynamic Ajax
Hi,
I have a page with a dropdown list (<select>) and when I select an element
in the list, I'd like a modal window to open with the datas related to the
element I selected.
To do so, I tried 2 things :
1) "Classic method" :
$('#unitInfos')
.jqDrag('.jqDrag')
.jqResize('.jqResize')
.jqm({
ajax: 'ajax/unitInfos.php?id='+document.forms[0].elements[4].value,
target: '.jqmnContent p',
trigger:'#unitInfosTrigger',
overlay: 0,
onShow: function(h) {
h.w.css('opacity',0.92).slideDown();
},
onHide: function(h) {
h.w.slideUp("slow",function() { if(h.o) h.o.remove(); }); }
});
With this, I have to add a button next to the <select> and define it as a
trigger. When I click on it, the modal open. It is draggable, resizable and
closable. If i change the <select> value, the content of the modal is not
updated
2) "Onchange method" :
I add a onchange="updateUnit();" on my select and define a new function :
function updateUnit() {
$('#unitInfos')
.jqDrag('.jqDrag')
.jqResize('.jqResize')
.jqm({
ajax: false,
overlay: 0,
onShow: function(h) {
h.w.load("ajax/unitInfos.php", {id:
document.forms[0].elements[4].value});
h.w.css('opacity',0.92).slideDown(); // hide window
},
onHide: function(h) {
h.w.slideUp("slow",function() { if(h.o) h.o.remove(); }); }
})
.jqmShow();
}
The modal display the right datas but it's no more closable, resizable nor
draggable.
You can see the 2 pages here :
gaiaservice.dyndns.org/projets/jqmodal/method1.php
gaiaservice.dyndns.org/projets/jqmodal/method2.php
Any help woul be very appreciated.
Thanks
Chag
--
View this message in context: http://www.nabble.com/jqModal-and-dynamic-Ajax-tp17514602s27240p17514602.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.