Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
148366 | Oct 16,2019 07:08 PM UTC | Oct 18,2019 06:50 AM UTC | ASP.NET MVC - EJ 2 | 3 |
![]() |
Tags: Grid |
@Html.EJS().Grid("Grid").DataSource(ds => ds.Url("/Home/UrlDatasource").Adaptor("UrlAdaptor").InsertUrl("/Home/Insert").RemoveUrl("/Home/Remove")
.UpdateUrl("/Home/Update")).Columns(col =>
{
col.Field("OrderID").HeaderText("Order ID").Width("120").IsPrimaryKey(true).TextAlign(Syncfusion.EJ2.Grids.TextAlign.Right).Add();
. . . .
}).Height("400").AllowExcelExport().AllowPaging().AllowFiltering(true).AllowGrouping().AllowSorting().FilterSettings(filter => { filter.Type(Syncfusion.EJ2.Grids.FilterType.Menu); }).ToolbarClick("toolbarClick").Toolbar(new List<string>
() { "ExcelExport" }).Render()
</div>
<script>
function toolbarClick(args) {
var gridObj = document.getElementById("Grid").ej2_instances[0];
if (args.item.id === 'Grid_excelexport') {
var query = gridObj.renderModule.data.generateQuery(true);
// execute the action queries in getDataModule.
gridObj.getDataModule().executeQuery(query).then((e) => {
console.log(e.result); // you can retrieve the all data after filter and grouping
})
gridObj.excelExport();
}
}
</script>
|
var query = gridObj.renderModule.data.generateQuery(true);
// execute the action queries in getDataModule..
new ej.data.DataManager({url:"gr"}).executeQuery(query).then((e) => {
console.log(e.result); // you can retrive the all data after filter and grouping
}).catch((e) => {
console.log(e.error);
}); |
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.