2012-11-05 19 views
5

JQuery Mobile simpledialog() dinamik verilerimi sayfadan temizler. Aslında simpledialog istemini kullanarak kaydı sildiğim bir listeye sahibim. Ama bu dinamik olarak oluşturulan listeyi temizleyecektir, bu yüzden listeyi geri almak için sayfasını yeniden yüklemem gerekir. Bundan kurtulmanın bir yolu var mı? 'Eğer bunu ayarlarken her zaman olduğu gibi 'gerçek' olmasıJQuery Mobile simpledialog dinamik verilerimi sayfasından temizler

if (data = 'true') 

Will : Bu

$('#Delete').simpledialog({ 

'mode': 'bool', 
'prompt': 'Are you sure to deactivate'?', 
'useModal': true, 
'buttons': { 
    'OK': { 
     click: function() { 
      $('#dialogoutput').text('OK'); 
      $.ajax({ 
       type: 'POST', 
       url: deactivateUrl, 
       data: { postVar: postDeactivate }, 
       beforeSend: function() { 
        showPageLoading("De-Activating.."); 
       }, 
       success: function (data) { 
        hidePageLoading(); 
        if (data = 'true') { 
         notification("Record Deactivated!"); 
         location.reload(); 
        } 
        else { 
         notification("Deactivation failed."); 
        } 
       }, 
       error: function() { 
        //alert("Error"); 
       } 
      }); 

     } 
    }, 
    'Cancel': { 
     click: function() { 
      $('#dialogoutput').text('Cancel'); 
      location.reload(); 
     }, 
     icon: "delete", 
     theme: "c" 
    } 
} 
}); 

cevap

0

You have,

if (data = 'true') { 
    notification("Record Deactivated!"); 
    location.reload(); 
} 
else 
{ 
    notification("Deactivation failed."); 
} 

: Aşağıda

benim kodudur Tek bir eşit kullanma ile doğru.

Belki istedi:

if (data == 'true') 

VEYA

if (data === true)