Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
144570 | May 13,2019 04:54 AM UTC | May 14,2019 11:51 AM UTC | ASP.NET Core - EJ 2 | 5 |
![]() |
Tags: DataGrid |
<ejs-grid id="GridNewKeywords" allowPaging="true" load="onLoad" actionFailure="actionFailure"
toolbar="@( new List<object>() {" Add","Edit","Delete","Update","Cancel"})">// you need to write like “Add” |
<ejs-grid id="Grid" allowPaging="true" load="onLoad" actionBegin="begin" allowFiltering="true" toolbar="@( new List<object>() {"Add","Edit","Delete","Update","Cancel","Search" })">
<e-grid-editSettings allowAdding="true" allowDeleting="true" allowEditing="true"></e-grid-editSettings>
<e-data-manager url="/Index?handler=DataSource" insertUrl="/Index?handler=Insert" updateUrl="/Index?handler=Update" removeUrl="/Index?handler=Delete" adaptor="UrlAdaptor"></e-data-manager>
<e-grid-columns>
...
</e-grid-columns>
</ejs-grid>
<script>
function onLoad() {
this.dataSource.dataSource.headers = [{ 'XSRF-TOKEN': $("input:hidden[name='__RequestVerificationToken']").val() }];
}
function begin(args) {
var grid = document.getElementsByClassName('e-grid')[0].ej2_instances[0]
console.log(args);
if (args.requestType == 'delete') {
grid.dataSource.dataSource.headers = [];
grid.dataSource.dataSource.headers.push({ 'XSRF-TOKEN': $("input:hidden[name='__RequestVerificationToken']").val(), "KeywordId": args.data[0].EmployeeID, "UserId": args.data[0].Freight });
}
}
</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.