summaryrefslogtreecommitdiffstats
path: root/slick.dataview.js
diff options
context:
space:
mode:
authorMichael Leibman <michael.leibman@gmail.com>2011-03-11 11:52:14 -0800
committerMichael Leibman <michael.leibman@gmail.com>2011-03-11 11:52:14 -0800
commit1bcde68f03ad938137df0c38a032fd3842f70eea (patch)
treef605c0a35f724abb981deaa1e68098ce1ff301b1 /slick.dataview.js
parentb192b6c4837df5bfac425cf4fad0568d7cc80a56 (diff)
downloadSlickGrid-1bcde68f03ad938137df0c38a032fd3842f70eea.zip
SlickGrid-1bcde68f03ad938137df0c38a032fd3842f70eea.tar.gz
SlickGrid-1bcde68f03ad938137df0c38a032fd3842f70eea.tar.bz2
Fixed example pages using DataView.
DataView now lazy-inits the GroupItemMetadataProvider only when grouping is performed, so no need to include its .js file if grouping isn't needed.
Diffstat (limited to 'slick.dataview.js')
-rw-r--r--slick.dataview.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/slick.dataview.js b/slick.dataview.js
index cc916b4..7c3f886 100644
--- a/slick.dataview.js
+++ b/slick.dataview.js
@@ -23,7 +23,7 @@
var self = this;
var defaults = {
- groupItemMetadataProvider: new Slick.Data.GroupItemMetadataProvider()
+ groupItemMetadataProvider: null
};
@@ -155,6 +155,10 @@
}
function groupBy(valueGetter, valueFormatter, sortComparer) {
+ if (!options.groupItemMetadataProvider) {
+ options.groupItemMetadataProvider = new Slick.Data.GroupItemMetadataProvider();
+ }
+
groupingGetter = valueGetter;
groupingGetterIsAFn = typeof groupingGetter === "function";
groupingFormatter = valueFormatter;