diff options
author | Michael Leibman <michael.leibman@gmail.com> | 2013-12-03 19:05:19 -0800 |
---|---|---|
committer | Michael Leibman <michael.leibman@gmail.com> | 2013-12-03 21:11:29 -0800 |
commit | dc5f4cef17925db0367ef18091d5d88dbaf62e97 (patch) | |
tree | a1250137f34cd4e9f5da2df8d95d116f914bc4a4 /examples/example-grouping.html | |
parent | e0fa6a89e763d4136210ae04230f2080b1001299 (diff) | |
download | SlickGrid-dc5f4cef17925db0367ef18091d5d88dbaf62e97.zip SlickGrid-dc5f4cef17925db0367ef18091d5d88dbaf62e97.tar.gz SlickGrid-dc5f4cef17925db0367ef18091d5d88dbaf62e97.tar.bz2 |
Implement lazy totals calculation in the DataView.
Add a ‘lazyTotalsCalculation’ grouping info option (default = false)
that delays the totals calculation until the item is accessed via
getItem(index). This can dramatically improve the perceived
performance of the DataView operations on very large datasets.
Diffstat (limited to 'examples/example-grouping.html')
-rw-r--r-- | examples/example-grouping.html | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/examples/example-grouping.html b/examples/example-grouping.html index 86bbd4a..356ade7 100644 --- a/examples/example-grouping.html +++ b/examples/example-grouping.html @@ -170,7 +170,8 @@ function groupByDuration() { new Slick.Data.Aggregators.Avg("percentComplete"), new Slick.Data.Aggregators.Sum("cost") ], - aggregateCollapsed: false + aggregateCollapsed: false, + lazyTotalsCalculation: true }); } @@ -187,7 +188,8 @@ function groupByDurationOrderByCount(aggregateCollapsed) { new Slick.Data.Aggregators.Avg("percentComplete"), new Slick.Data.Aggregators.Sum("cost") ], - aggregateCollapsed: aggregateCollapsed + aggregateCollapsed: aggregateCollapsed, + lazyTotalsCalculation: true }); } @@ -202,7 +204,8 @@ function groupByDurationEffortDriven() { new Slick.Data.Aggregators.Sum("duration"), new Slick.Data.Aggregators.Sum("cost") ], - aggregateCollapsed: true + aggregateCollapsed: true, + lazyTotalsCalculation: true }, { getter: "effortDriven", @@ -213,7 +216,8 @@ function groupByDurationEffortDriven() { new Slick.Data.Aggregators.Avg("percentComplete"), new Slick.Data.Aggregators.Sum("cost") ], - collapsed: true + collapsed: true, + lazyTotalsCalculation: true } ]); } @@ -229,7 +233,8 @@ function groupByDurationEffortDrivenPercent() { new Slick.Data.Aggregators.Sum("duration"), new Slick.Data.Aggregators.Sum("cost") ], - aggregateCollapsed: true + aggregateCollapsed: true, + lazyTotalsCalculation: true }, { getter: "effortDriven", @@ -239,7 +244,8 @@ function groupByDurationEffortDrivenPercent() { aggregators :[ new Slick.Data.Aggregators.Sum("duration"), new Slick.Data.Aggregators.Sum("cost") - ] + ], + lazyTotalsCalculation: true }, { getter: "percentComplete", @@ -250,7 +256,8 @@ function groupByDurationEffortDrivenPercent() { new Slick.Data.Aggregators.Avg("percentComplete") ], aggregateCollapsed: true, - collapsed: true + collapsed: true, + lazyTotalsCalculation: true } ]); } @@ -265,7 +272,7 @@ function loadData(count) { d["id"] = "id_" + i; d["num"] = i; d["title"] = "Task " + i; - d["duration"] = Math.round(Math.random() * 14); + d["duration"] = Math.round(Math.random() * 30); d["percentComplete"] = Math.round(Math.random() * 100); d["start"] = someDates[ Math.floor((Math.random()*2)) ]; d["finish"] = someDates[ Math.floor((Math.random()*2)) ]; |