Skip to content

Instantly share code, notes, and snippets.

@cAstraea
Last active July 1, 2016 12:19
Show Gist options
  • Save cAstraea/ab855e3fe210154bb704500f23e38480 to your computer and use it in GitHub Desktop.
Save cAstraea/ab855e3fe210154bb704500f23e38480 to your computer and use it in GitHub Desktop.
$("#{{ target }}").dxSelectBox({
items: itemsArrayforSelectBox,
onValueChanged: function (e) {
swal({
title: "Are you sure?",
text: "Deleting !",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: "Yes, change it!",
closeOnConfirm: true,
html: false
}, function(confirmed){
if (confirmed)
{
console.log(e);
$("#livre_type").dxSelectBox('instance').option('value', e.value);
$.ajax({
url: "http://google.com",
type: "GET",
complete: function (data, statusText, xhr) {
function Person(firstName, lastName) {
this.data = data;
this.statusText = statusText;
this.xhr = xhr;
}
var jj = new Person(data,statusText, xhr);
console.table([jj]);
console.log(data.responseText)
if (statusText == "success") {
//it has been deleted<<
var gridInstance=$('#gridContainer').dxDataGrid('instance');
gridInstance.deleteRow(options.rowIndex);
}
else {
//rowInfo.cancel = true;
swal("Cancelled", "Not deleted :)", "error");
//error not deleted
}
}
});
}
else {
//
$("#livre_type").dxSelectBox('instance').option('value', e.previousValue);
}
});
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment