From 927bc3264775c8f201243d4935f45d5e3861d217 Mon Sep 17 00:00:00 2001 From: Rufus Pollock Date: Sun, 15 Apr 2012 23:26:57 +0100 Subject: [PATCH] [#88,view][s]: DataExplorer boots Grid, Graph and Map view by default instead of just Grid. * This makes DataExplorer.restore substantially more useful. --- src/view.js | 24 +++++++++++++++++++----- test/index.html | 6 ++++++ 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/src/view.js b/src/view.js index 5e3a4c02..0d26d24f 100644 --- a/src/view.js +++ b/src/view.js @@ -105,7 +105,8 @@ this.recline.View = this.recline.View || {}; // // **views**: (optional) the dataset views (Grid, Graph etc) for // DataExplorer to show. This is an array of view hashes. If not provided -// just initialize a Grid with id 'grid'. Example: +// initialize with (recline.View.)Grid, Graph, and Map views (with obvious id +// and labels!). // //
 // var views = [
@@ -142,8 +143,9 @@ this.recline.View = this.recline.View || {};
 // 
// // Note that at present we do *not* serialize information about the actual set -// of views in use -- e.g. those specified by the views argument. Instead we -// expect the client to have initialized the DataExplorer with the relevant views. +// of views in use -- e.g. those specified by the views argument -- but instead +// expect either that the default views are fine or that the client to have +// initialized the DataExplorer with the relevant views themselves. my.DataExplorer = Backbone.View.extend({ template: ' \
\ @@ -189,8 +191,20 @@ my.DataExplorer = Backbone.View.extend({ id: 'grid', label: 'Grid', view: new my.Grid({ - model: this.model - }) + model: this.model + }) + }, { + id: 'graph', + label: 'Graph', + view: new my.Graph({ + model: this.model + }) + }, { + id: 'map', + label: 'Map', + view: new my.Map({ + model: this.model + }) }]; } this.state = new recline.Model.ObjectState(); diff --git a/test/index.html b/test/index.html index 6d0838a6..da0e90b8 100644 --- a/test/index.html +++ b/test/index.html @@ -4,12 +4,15 @@ Qunit Tests + + + @@ -29,10 +32,13 @@ + + +