dialog close event
dialog close event
Hey all,
Just having trouble with dialog close event. Here is my situation, I load the dialog and everything works fine, there is a form in this dialog which is used to update some data on the database...still working correctly, now, what I'm trying to do is, when the user close the dialog, the main page is loaded again, so it will show the changes he made without refreshing the screen...
Here is my function
- function updateSpec()
- {
- var hareaold = $('#hareaold'),
- otherold = $('#otherold'),
- qtyold = $('#qtyold'),
- mqtyold = $('#mqtyold'),
- mrateold = $('#mrateold'),
- totalold = $('#totalold'),
- sitespecid = <?php echo $_POST['sitespecid'];?>,
- siteid = <?php echo $_POST['siteid'];?>;
-
- if ($('#colourold')){
- var colourold = $('#colourold');
- }
- var harea = $('#harea'),
- optionid = $('#optionid'),
- other = $('#other'),
- cost = $('#costa'),
- qty = $('#qty'),
- mqty = $('#mqty'),
- mrate = $('#mrate'),
- total = $('#total');
- if ($('#colour')){
- var colourid = $('#colour');
- if (colourid.val() != colourold.val()){
- colourid = null;
- }
- }
- if (qty.val() < 1){
- $('#qty_err').detach();
- qty.css('border', '1px solid #F00');
- updateError("Quantity can't be 0!", $('#qtyele'));
- } else {
- qty.css('border', '1px solid #7EBC42');
- $('#qty_err').detach();
- }
-
- $.ajax({
- url: "includes/updatespecification.php",
- type: "POST",
- data: ({sitespecid: sitespecid,
- sitehareaid: harea.val(),
- optionid: optionid.val(),
- colourid: colourid.val(),
- other: other.val(),
- cost: cost.val(),
- qty: qty.val(),
- mqty: mqty.val(),
- mrate: mrate.val(),
- total: total.val()}),
- success: function(){
- $('.boxContainer').show();
- loadcurrProduct();
- }
- });
- $('#editspec').dialog('close');
- refreshClientinfo();
- }
And here is the refreshClientinfo function
- function refreshClientinfo()
- {
- var area = $('#houseareadropdown').val();
- var catid = $('#categorydropdown').val();
- var filter = $('#filter').val();
- var show = $('#show').val();
- $('#clientinfo').load('includes/getsitespecifications.php', {s: 3616, c: 74, f: 1, h: 30});
- }
What happen is, it works on the first time, but then, when you hit the close button, the dialog updates everything, and even refresh the data on the clientinfo div, but the dialog doesn't close.....
I can't figure out why, is it a bug on Jquery? or something wrong on my code????
Cheers