JQuery Mobile simpledialog()从页面中清除我的动态数据.实际上我有一个列表,我使用simpledialog提示从中删除记录.但这将清除我动态生成的列表,所以我必须重新加载页面以获取列表.有没有选择摆脱这个.
以下是我的代码:
$('#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", …Run Code Online (Sandbox Code Playgroud)