[{"OrgID":1,"Name":"Agency, LLC","Nickname":"Agency","Description":"This is a demo agency","UserID":"8e82ece1-a036-4618-a116-13ac406629ac","User":null,"AddressID":2,"Address":null,"OfficePhone":"864-555-5555","OtherPhone":null,"OrganizationTypeID":2,"OrganizationType":null,"RouteOrgDonors":null,"RouteOrgAgencies":null,"AvailableOrgs":null,"DateAdded":"2019-07-08T08:56:41.1333333"},{"OrgID":2,"Name":"Donor LLC","Nickname":"Donor","Description":"Demo donor","UserID":"8e82ece1-a036-4618-a116-13ac406629ac","User":null,"AddressID":1,"Address":null,"OfficePhone":"864-555-5555","OtherPhone":null,"OrganizationTypeID":1,"OrganizationType":null,"RouteOrgDonors":null,"RouteOrgAgencies":null,"AvailableOrgs":null,"DateAdded":"2019-07-08T09:46:20.8533333"},{"OrgID":3,"Name":"Agency 2, LLC","Nickname":"Agency 2","Description":"Test","UserID":"8e82ece1-a036-4618-a116-13ac406629ac","User":null,"AddressID":2,"Address":null,"OfficePhone":null,"OtherPhone":null,"OrganizationTypeID":2,"OrganizationType":null,"RouteOrgDonors":null,"RouteOrgAgencies":null,"AvailableOrgs":null,"DateAdded":"2019-09-03T14:39:23.02"},{"OrgID":4,"Name":"Donor 2, LLC","Nickname":"Donor 2","Description":"Test","UserID":null,"User":null,"AddressID":1,"Address":null,"OfficePhone":null,"OtherPhone":null,"OrganizationTypeID":1,"OrganizationType":null,"RouteOrgDonors":null,"RouteOrgAgencies":null,"AvailableOrgs":null,"DateAdded":"2019-09-03T14:39:46.9033333"}]
<ejs-grid id="GridOverview" allowFiltering="true" allowPaging="true" allowSorting="true">
<e-data-manager url="/Home/UrlDataSource" adaptor="UrlAdaptor"></e-data-manager>
<e-grid-pagesettings pageSize="4"></e-grid-pagesettings>
<e-grid-columns>
...
<e-grid-column field="ShipCountry" headerText="Ship Country" width="150"></e-grid-column>
<e-grid-column field="Employee.Address" headerText="Address" type="string" width="90"></e-grid-column>
</e-grid-columns>
</ejs-grid> |
public IActionResult UrlDatasource([FromBody]DataManagerRequest dm)
{
IEnumerable DataSource = OrdersDetails.GetAllRecords();
DataOperations operation = new DataOperations();
if (dm.Search != null && dm.Search.Count > 0)
{
DataSource = operation.PerformSearching(DataSource, dm.Search); //Search
}
if (dm.Sorted != null && dm.Sorted.Count > 0) //Sorting
{
DataSource = operation.PerformSorting(DataSource, dm.Sorted);
}
...
return dm.RequiresCounts ? Json(new { result = DataSource, count = count }) : Json(DataSource);
} |
|