forked from NuCivic/openfda.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathview.js
executable file
·71 lines (66 loc) · 1.58 KB
/
view.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
jQuery(function($) {
window.multiView = null;
window.explorerDiv = $('.data-explorer-here');
});
// make MultivView
//
// creation / initialization in a function so we can call it again and again
var createMultiView = function(dataset, state) {
// remove existing multiview if present
var reload = false;
if (window.multiView) {
window.multiView.remove();
window.multiView = null;
reload = true;
}
var $el = $('<div />');
$el.appendTo(window.explorerDiv);
// customize the subviews for the MultiView
var views = [
{
id: 'grid',
label: 'Grid',
view: new recline.View.SlickGrid({
model: dataset,
state: {
gridOptions: {
editable: true,
// Enable support for row add
enabledAddRow: true,
// Enable support for row delete
enabledDelRow: true,
// Enable support for row ReOrder
enableReOrderRow:true,
autoEdit: false,
enableCellNavigation: true
},
columnsEditor: [
{ column: 'date', editor: Slick.Editors.Date },
{ column: 'sometext', editor: Slick.Editors.Text }
]
}
})
},
{
id: 'graph',
label: 'Graph',
view: new recline.View.Graph({
model: dataset
})
},
{
id: 'map',
label: 'Map',
view: new recline.View.Map({
model: dataset
})
}
];
var multiView = new recline.View.MultiView({
model: dataset,
el: $el,
state: state,
views: views
});
return multiView;
}