Hello,
I am evaluating ejGrid and my customer's required functionality is:
- grid in virtual mode
- all operations like sorting, grouping, paging provided server-side
(custom WebSocket based communication layer connected to DataManager)
- grouping:
- at the beginning, list of all groups is read and displayed
collapsed (server-side prepared list of groups with record count for
each group and total record count), without "leafs" (records)
- they would like to have even the list of groups being
virtualized, but I cannot image how it would be done and how server-side
data access would be handled
- when group is expanded, records are loaded in virtual mode as the user scrolls
Similiar way, they require it for ejTreeGrid. As they expect millions of rows, maximal virtualization support for any tree level is requested.
If the required functionality is not possible natively by the
components, is there a way I could handle some events or override some
methods (ejGrid, ejTreeGrid, DataManager) to achive that?
If I'm able to react on expanding, collapsing, scrolling, I can imagine the goal could be reached.
Thank you,
Petr Langer
<div id="Grid"></div>
<script type="text/javascript">
$(function () {
var dataManager = ej.DataManager({
url: "/Home/DataSource",
adaptor: new ej.UrlAdaptor(),
});
$("#Grid").ejGrid({
dataSource: dataManager,
allowPaging: true,
allowGrouping: true,
allowSorting: true,
allowFiltering: true,
columns: [
{ field: "OrderID", isPrimaryKey: true },
. .
]
});
});
</script>
public ActionResult DataSource(DataManager dm)
{
IEnumerable result = null;
int count = 0;
IEnumerable DataSource = new NorthwindDataContext().OrdersViews.ToList();
DataOperations operation = new DataOperations();
if (dm.Where != null)
DataSource = operation.PerformWhereFilter(DataSource, dm.Where, dm.Where[0].Condition);
if (dm.Sorted != null)
DataSource = operation.PerformSorting(DataSource, dm.Sorted);
count = DataSource.AsQueryable().Count();
if (dm.Skip != null && dm.Skip != 0)//skipped records based
DataSource = operation.PerformSkip(DataSource, dm.Skip);
if (dm.Take != null && dm.Take != 0)//take needed records.
DataSource = operation.PerformTake(DataSource, dm.Take);
result = DataSource;
return Json(new { result = result, count = count }, JsonRequestBehavior.AllowGet);
} |