Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
144800 | May 23,2019 10:46 AM UTC | May 30,2019 01:26 PM UTC | Angular - EJ 2 | 4 |
![]() |
Tags: Grid |
<ejs-grid #grid [dataSource]='data' allowGrouping="true" allowFiltering="true" allowPaging="true" allowSorting="true" height="320">
<e-columns>
<e-column field='OrderID' headerText='Order ID' isPrimaryKey=true width='150'></e-column>
<e-column field='CustomerID' headerText='Customer Name' width='150'></e-column>
<e-column field='ShipCity' headerText='ShipCity' width='150' textAlign='Right'></e-column>
</e-columns>
</ejs-grid> |
ngOnInit(): void {
this.data = new DataManager({
url: 'Home/UrlDatasource',
adaptor: new UrlAdaptor
});
} |
public IActionResult UrlDatasource([FromBody]DataManagerRequest dm)
{
IEnumerable DataSource = OrdersDetails.GetAllRecords();
DataOperations operation = new DataOperations();
. . . . .
int count = DataSource.Cast<OrdersDetails>().Count(); // Total Count of the Grid DataSource
if (dm.Skip != 0)
{
DataSource = operation.PerformSkip(DataSource, dm.Skip); //Paging
}
if (dm.Take != 0)
{
DataSource = operation.PerformTake(DataSource, dm.Take);
}
return dm.RequiresCounts ? Json(new { result = DataSource, count = count}) : Json(DataSource);
}
|
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.