Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
140838 | Nov 9,2018 04:48 PM UTC | Nov 15,2018 07:32 AM UTC | ASP.NET Core - EJ 2 | 4 |
![]() |
Tags: DataGrid |
<ejs-toast id="element">
<e-toast-position X="Right"></e-toast-position>
</ejs-toast>
<ejs-grid id="Grid" allowPaging="true" created="created">
.....
</ejs-grid>
<script type="text/javascript">
function created(args) {
// extending the default UrlAdaptor
class CustomAdaptor extends ej.data.UrlAdaptor {
processResponse(data, ds, query, xhr, request, changes) {
if (!ej.base.isNullOrUndefined(data.message)) {
setTimeout(
() => {
var toastObj = document.getElementById('element').ej2_instances[0];
toastObj.content = data.message;
toastObj.target = document.body;
toastObj.show();
}, 500);
}
.....
}
}
};
</script> |
<ejs-toast id="element">
<e-toast-position X="Right"></e-toast-position>
</ejs-toast>
<ejs-grid id="Grid" actionFailure="actionFailure">
</ejs-grid>
<script type="text/javascript">
function actionFailure(args) {
setTimeout(
() => {
var toastObj = document.getElementById('element').ej2_instances[0];
toastObj.content = args.error[0].error.response.match("Internal Server Error")[0];
toastObj.target = document.body;
toastObj.show();
}, 500);
}
</script> |
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.