-
Notifications
You must be signed in to change notification settings - Fork 36
/
index.html
188 lines (165 loc) · 9.37 KB
/
index.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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title><hot-table></title>
<!-- Importing Web Component's Polyfill -->
<script src="../webcomponentsjs/webcomponents-lite.js"></script>
<!-- Code highlighter -->
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/styles/default.min.css">
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/highlight.min.js"></script>
<link href="http://fonts.googleapis.com/css?family=Open+Sans+Condensed:300" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="examples/css/main.css"/>
<!-- Importing Custom Elements -->
<link rel="import" href="hot-table.html">
</head>
<body>
<div id="wrapper">
<header>
<h1><hot-table></h1>
<h2 class="logo-desc">Polymer Element wrapper for <a href="http://handsontable.com">Handsontable</a> data grid editor</h2>
</header>
<p class="warning">Some stuff does not work yet. <b>For now it is not ready for production!</b> <br>
But feel free to submit issues on GitHub.</p>
<h2>Install</h2>
<br>
Install the component using Bower:
<pre><code class="bash">
$ bower install hot-table --save
</code></pre>
Or <a href="https://github.com/handsontable/hot-table/archive/master.zip">download as ZIP</a>.
<h2>Usage</h2>
<br>
1. Import Web Components' polyfill:
<pre><code class="html">
<script src="bower_components/webcomponentsjs/webcomponents-lite.js"></script>
</code></pre>
2. Import Custom Element:
<pre><code class="html">
<link rel="import" href="bower_components/hot-table/hot-table.html">
</code></pre>
3. Start using it!
<pre><code class="html">
<hot-table datarows="{{ itemsArray }}"></hot-table>
</code></pre>
<a href="https://github.com/handsontable/hot-table" class="fork-me">
<img src="http://aral.github.com/fork-me-on-github-retina-ribbons/[email protected]" alt="Fork me on GitHub">
</a>
<h2>Simple Example</h2>
<div class="example">
<dom-bind>
<template>
<p>
Name of first person: <strong>{{ people.0.name.first }}</strong> | Highlighted row: <strong>{{ highlightedRow }}</strong>
</p>
<hot-table width="655" height="295" datarows="{{ people }}" context-menu max-rows="{{ people.length }}"
highlighted-row="{{ highlightedRow }}" class="htLeft">
<hot-column width="30" read-only value="id" header="ID"></hot-column>
<hot-column value="name.first" header="First Name">
<template data-hot-role="renderer" is="dom-template"><span>{{ value }}</span>...</template>
</hot-column>
<hot-column width="100" value="name.last" header="Last Name"></hot-column>
<hot-column width="100" type="date" value="date" header="Birthday"></hot-column>
<hot-column value="gender" header="Gender" source="[[ genderSource ]]" type="dropdown"></hot-column>
<hot-column type="numeric" value="age" header="Age"></hot-column>
<hot-column type="checkbox" value="languages.english" header="English" checked-template="Yes"
unchecked-template="No"></hot-column>
<hot-column type="checkbox" value="languages.spanish" header="Spanish" checked-template="Yes"
unchecked-template="No"></hot-column>
<hot-column type="checkbox" value="languages.french" header="French" checked-template="Yes"
unchecked-template="No"></hot-column>
<hot-column type="numeric" value="salary" header="Salary" format="$ 0,0.00"></hot-column>
</hot-table>
</template>
</dom-bind>
</div>
<h2>Code</h2>
<pre><code class="html">
<dom-bind>
<template>
<p>
Name of first person: <strong>{{ people.0.name.first }}</strong> | Highlighted row: <strong>{{ highlightedRow }}</strong>
</p>
<hot-table width="655" height="295" datarows="{{ people }}" context-menu max-rows="{{ people.length }}"
highlighted-row="{{ highlightedRow }}" class="htLeft">
<hot-column width="30" read-only value="id" header="ID"></hot-column>
<hot-column value="name.first" header="First Name">
<template data-hot-role="renderer" is="dom-template"><span>{{ value }}</span>...</template>
</hot-column>
<hot-column width="100" value="name.last" header="Last Name"></hot-column>
<hot-column width="100" type="date" value="date" header="Birthday"></hot-column>
<hot-column value="gender" header="Gender" source="[[ genderSource ]]" type="dropdown"></hot-column>
<hot-column type="numeric" value="age" header="Age"></hot-column>
<hot-column type="checkbox" value="languages.english" header="English" checked-template="Yes"
unchecked-template="No"></hot-column>
<hot-column type="checkbox" value="languages.spanish" header="Spanish" checked-template="Yes"
unchecked-template="No"></hot-column>
<hot-column type="checkbox" value="languages.french" header="French" checked-template="Yes"
unchecked-template="No"></hot-column>
<hot-column type="numeric" value="salary" header="Salary" format="$ 0,0.00"></hot-column>
</hot-table>
</template>
</dom-bind>
</code></pre>
<h2>Demos</h2>
<ul>
<li><a href="examples/renderers.html">Custom Renderers</a></li>
<li><a href="examples/editors.html">Custom Editors</a></li>
<li><a href="examples/dashboard.html">Dashboard</a></li>
<li><a href="examples/persistent-state.html">Saving table state (persistent state)</a></li>
<li><a href="examples/dynamically-generated-context-menu.html">Dynamically generated context menu</a></li>
</ul>
<h2>PRO features</h2>
<br>
<p>
To install Handsontable PRO follow by this instructions.
</p>
Install the component using Bower:
<pre><code class="bash">
$ bower install hot-table --save
</code></pre>
Overwrite handsontable version with handsontable PRO:
<pre><code class="bash">
$ bower install [email protected]:handsontable/handsontable-pro.git --save
</code></pre>
<i>If you don't have license for Pro yet, please click <a href="https://handsontable.com/pricing">here</a> for more info.</i>
<h2>PRO features demos</h2>
<ul>
<li><a href="examples/data-filtering.html">Data filtering</a></li>
<li><a href="examples/bind-rows-with-headers.html">Bind rows with headers</a></li>
<li><a href="examples/fixing-bottom-rows.html">Fixing bottom rows</a></li>
</ul>
<script>
var people = [
{id: 1, date: '24/12/1986', name: {first: 'Joe', last: 'Fabiano'}, gender: 'Male', age: 21,
languages: {english: 'Yes', spanish: 'Yes', french: 'No'}, salary: 2000},
{id: 2, date: '30/01/1976', name: {first: 'Fred', last: 'Wecler'}, gender: 'Male', age: 25,
languages: {english: 'Yes', spanish: 'No', french: 'No'}, salary: 2500},
{id: 3, date: '14/07/1967', name: {first: 'Steve', last: 'Wilson'}, gender: 'Male', age: 32,
languages: {english: 'Yes', spanish: 'No', french: 'No'}, salary: 1700},
{id: 4, date: '14/06/1956', name: {first: 'Maria', last: 'Fernandez'}, gender: 'Female', age: 27,
languages: {english: 'No', spanish: 'Yes', french: 'Yes'}, salary: 3000},
{id: 5, date: '09/05/1975', name: {first: 'Pierre', last: 'Barbault'}, gender: 'Male', age: 46,
languages: {english: 'Yes', spanish: 'No', french: 'Yes'}, salary: 1450},
{id: 6, date: '01/01/1986', name: {first: 'Nancy', last: 'Moore'}, gender: 'Female', age: 34,
languages: {english: 'Yes', spanish: 'No', french: 'No'}, salary: 2300},
{id: 7, date: '04/03/1994', name: {first: 'Barbara', last: 'MacDonald'}, gender: 'Female', age: 19,
languages: {english: 'Yes', spanish: 'No', french: 'No'}, salary: 1900},
{id: 8, date: '01/04/1993', name: {first: 'Wilma', last: 'Williams'}, gender: 'Female', age: 33,
languages: {english: 'Yes', spanish: 'Yes', french: 'Yes'}, salary: 2400},
{id: 9, date: '01/05/1982', name: {first: 'Sasha', last: 'Silver'}, gender: 'Male', age: 27,
languages: {english: 'Yes', spanish: 'No', french: 'Yes'}, salary: 2110},
{id: 10, date: '03/10/1992', name: {first: 'Don', last: 'Pérignon'}, gender: 'Male', age: 42,
languages: {english: 'No', spanish: 'No', french: 'Yes'}, salary: 2090},
{id: 11, date: '01/10/1991', name: {first: 'Aaron', last: 'Kinley'}, gender: 'Female', age: 33,
languages: {english: 'Yes', spanish: 'Yes', french: 'Yes'}, salary: 2799}
];
var domBind = document.querySelector('dom-bind');
domBind.highlightedRow = -1;
domBind.people = people;
domBind.genderSource = ['Male', 'Female'];
</script>
<script>hljs.initHighlightingOnLoad();</script>
</div>
</body>
</html>