function onActionFailure(args) { console.log(args.error[0].error); alert(args.error[0].error.responseURL + " "+ args.error[0].error.status + ' (' + args.error[0].error.statusText + ")"); } |
<ejs-schedule id="schedule" width="100%" created="onCreate" height="550">
</ejs-schedule>
<script type="text/javascript">
function onCreate() {
class CustomAdaptor extends ej.data.UrlAdaptor {
processResponse() {
// calling base class processResponse function
var original = super.processResponse.apply(this, arguments);
if (arguments[4].url === "Home/UpdateData" && arguments[3].response !== "") {
alert(arguments[3].response);
}
return original;
}
}
var schObj = document.querySelector('.e-schedule').ej2_instances[0];
schObj.eventSettings.dataSource = new ej.data.DataManager({
url: "/Home/LoadData", crudUrl: "Home/UpdateData",
adaptor: new CustomAdaptor(), crossDomain: true
});
}
</script> |