forked from handsontable/handsontable
-
Notifications
You must be signed in to change notification settings - Fork 0
/
handsontable.html
169 lines (145 loc) · 5.63 KB
/
handsontable.html
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
<!doctype html>
<html>
<head>
<meta charset='utf-8'>
<title>Handsontable cell type - Handsontable</title>
<!--
Loading Handsontable (full distribution that includes all dependencies apart from jQuery)
-->
<script data-jsfiddle="common" src="../lib/jquery.min.js"></script>
<script data-jsfiddle="common" src="../dist/jquery.handsontable.full.js"></script>
<link data-jsfiddle="common" rel="stylesheet" media="screen" href="../dist/jquery.handsontable.full.css">
<!--
Loading demo dependencies. They are used here only to enhance the examples on this page
-->
<link data-jsfiddle="common" rel="stylesheet" media="screen" href="css/samples.css">
<script src="js/samples.js"></script>
<script src="js/highlight/highlight.pack.js"></script>
<link rel="stylesheet" media="screen" href="js/highlight/styles/github.css">
<!--
Facebook open graph. Don't copy this to your project :)
-->
<meta property="og:title" content="Handsontable cell type">
<meta property="og:description"
content="This page shows very specific example of using Handsontable as a cell editor in Handsontable.">
<meta property="og:url" content="http://handsontable.com/demo/handsontable.html">
<meta property="og:image" content="http://handsontable.com/demo/image/og-image.png">
<meta property="og:image:type" content="image/png">
<meta property="og:image:width" content="409">
<meta property="og:image:height" content="164">
<link rel="canonical" href="http://handsontable.com/demo/handsontable.html">
<!--
Google Analytics for GitHub Page. Don't copy this to your project :)
-->
<script src="js/ga.js"></script>
<script data-jsfiddle="common">
function getCarData() {
return [
["Nissan", 2009, "black", "black"],
["Nissan", 2006, "blue", "blue"],
["Chrysler", 2004, "yellow", "black"],
["Volvo", 2012, "white", "gray"]
];
}
</script>
</head>
<body>
<a href="http://github.com/warpech/jquery-handsontable" class="forkMeOnGitHub">Fork me on GitHub</a>
<div id="container">
<div class="columnLayout">
<div class="rowLayout">
<div class="descLayout">
<div class="pad">
<h1><a href="../index.html">Handsontable</a></h1>
<div class="tagline">a minimalistic Excel-like <span class="nobreak">data grid</span> editor
for HTML, JavaScript & jQuery
</div>
</div>
</div>
</div>
<div class="rowLayout">
<div class="descLayout">
<div class="pad" data-jsfiddle="example1">
<a name="lazy"></a>
<h2>Handsontable cell type</h2>
<p>This page shows very specific example of using Handsontable as a cell editor in Handsontable (sometimes
referred as <strong>Handsontable in Handsontable</strong>).</p>
<p>This is a work in progress started in HT version 0.8.16. Use at your own risk!</p>
<div id="example1"></div>
<p>
<button name="dump" data-dump="#example1" title="Prints current data source to Firebug/Chrome Dev Tools">
Dump
data to console
</button>
</p>
</div>
</div>
<div class="codeLayout">
<div class="pad">
<div class="jsFiddle">
<div class="jsFiddleLink" data-runfiddle="example1">Edit in jsFiddle</div>
</div>
<script data-jsfiddle="example1">
var carData = getCarData();
var manufacturerData = [
{name: "BMW", country: "Germany", owner: "Bayerische Motoren Werke AG"},
{name: "Chrysler", country: "USA", owner: "Chrysler Group LLC"},
{name: "Nissan", country: "Japan", owner: "Nissan Motor Company Ltd"},
{name: "Suzuki", country: "Japan", owner: "Suzuki Motor Corporation"},
{name: "Toyota", country: "Japan", owner: "Toyota Motor Corporation"},
{name: "Volvo", country: "Sweden", owner: "Zhejiang Geely Holding Group"}
];
var colors = ["yellow", "red", "orange", "green", "blue", "gray", "black", "white"];
var colorData = [];
var color;
while (color = colors.shift()) {
colorData.push([
[color]
]);
}
$("#example1").handsontable({
data: carData,
startRows: 7,
startCols: 4,
colHeaders: ["Car", "Year", "Chassis color", "Bumper color"],
columns: [
{
type: 'handsontable',
handsontable: {
colHeaders: ['Marque', 'Country', 'Parent company'],
data: manufacturerData
}
},
{type: 'numeric'},
{
type: 'handsontable',
handsontable: {
colHeaders: false,
data: colorData
}
},
{
type: 'handsontable',
handsontable: {
colHeaders: false,
data: colorData
}
}
]
});
</script>
</div>
</div>
</div>
<div class="rowLayout">
<div class="descLayout noMargin">
<div class="pad"><p>For more examples, head back to the <a href="../index.html">main page</a>.</p>
<p class="small">Handsontable © 2012 Marcin Warpechowski and contributors.<br> Code and documentation
licensed under the The MIT License.</p>
</div>
</div>
</div>
</div>
</div>
</body>
</html>