2012-11-05 1 views
5

JQuery Mobile simpledialog()가 페이지에서 내 동적 데이터를 지 웁니다. 사실 나는 simplemailog 프롬프트를 사용하여 레코드를 삭제할 목록이 있습니다. 그러나 이것은 목록을 되찾기 위해 페이지를 다시로드해야하므로 동적으로 생성 된 목록을 지울 것입니다. 이 문제를 해결할 수있는 옵션이 있습니까? '당신이 그것을 설정하는대로 항상이'사실 '이 될JQuery Mobile simpledialog가 페이지에서 내 동적 데이터를 지 웁니다.

if (data = 'true') 

:이

$('#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" 
    } 
} 
}); 

답변

0

당신이,

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

: 아래

내 코드입니다 하나의 동등한 것의 사용으로 '참'.

은 아마 당신은 원 :

if (data == 'true') 

또는

if (data === true) 
관련 문제