@@ -19,7 +19,7 @@ $ npm install nested-datatables
19
19
### Usage
20
20
21
21
``` js
22
- var table = new nestedTables.TableHierarchy (' example' , data, settings);
22
+ var table = new nestedTables.TableHierarchy (" example" , data, settings);
23
23
table .initializeTableHierarchy ();
24
24
```
25
25
@@ -61,8 +61,8 @@ Triggered when a child hierarchy is shown
61
61
62
62
``` js
63
63
// '#example' is wrapper ID for table hierarchy
64
- var tableEle = document .querySelector (' #example .table' );
65
- tableEle .addEventListener (' onShowChildHierarchy' , function (e ) {
64
+ var tableEle = document .querySelector (" #example .table" );
65
+ tableEle .addEventListener (" onShowChildHierarchy" , function (e ) {
66
66
console .log (e);
67
67
});
68
68
```
@@ -73,8 +73,8 @@ Triggered when a child hierarchy is hidden
73
73
74
74
``` js
75
75
// '#example' is wrapper ID for table hierarchy
76
- var tableEle = document .querySelector (' #example .table' );
77
- tableEle .addEventListener (' onHideChildHierarchy' , function (e ) {
76
+ var tableEle = document .querySelector (" #example .table" );
77
+ tableEle .addEventListener (" onHideChildHierarchy" , function (e ) {
78
78
console .log (e);
79
79
});
80
80
```
@@ -96,161 +96,161 @@ tableEle.addEventListener('onHideChildHierarchy', function(e) {
96
96
var dataInJson = [
97
97
{
98
98
data: {
99
- name: ' b1 ' ,
100
- street: ' s1 ' ,
101
- city: ' c1 ' ,
99
+ name: " b1 " ,
100
+ street: " s1 " ,
101
+ city: " c1 " ,
102
102
departments: 10 ,
103
- offices: 15
103
+ offices: 15 ,
104
104
},
105
105
kids: [
106
106
{
107
107
data: {
108
- department: ' HR ' ,
109
- supervisor: ' Isidor Bristol' ,
108
+ department: " HR " ,
109
+ supervisor: " Isidor Bristol" ,
110
110
floor: 1 ,
111
- employees: 15
111
+ employees: 15 ,
112
112
},
113
113
kids: [
114
114
{
115
115
data: {
116
- name: ' Klement Nikodemos' ,
117
- phone: ' +938462' ,
118
- hire_date: ' January 1, 2010' ,
119
- id: 3456
116
+ name: " Klement Nikodemos" ,
117
+ phone: " +938462" ,
118
+ hire_date: " January 1, 2010" ,
119
+ id: 3456 ,
120
120
},
121
- kids: []
121
+ kids: [],
122
122
},
123
123
{
124
124
data: {
125
- name: ' Madhava Helmuth' ,
126
- phone: ' +348902' ,
127
- hire_date: ' May 23, 2002' ,
128
- id: 1234
125
+ name: " Madhava Helmuth" ,
126
+ phone: " +348902" ,
127
+ hire_date: " May 23, 2002" ,
128
+ id: 1234 ,
129
129
},
130
- kids: []
130
+ kids: [],
131
131
},
132
132
{
133
133
data: {
134
- name: ' Andria Jesse' ,
135
- phone: ' 456123' ,
136
- hire_date: ' October 23, 2011' ,
137
- id: 9821
134
+ name: " Andria Jesse" ,
135
+ phone: " 456123" ,
136
+ hire_date: " October 23, 2011" ,
137
+ id: 9821 ,
138
138
},
139
- kids: []
140
- }
141
- ]
139
+ kids: [],
140
+ },
141
+ ],
142
142
},
143
143
{
144
144
data: {
145
- department: ' development' ,
146
- supervisor: ' Jim Linwood' ,
145
+ department: " development" ,
146
+ supervisor: " Jim Linwood" ,
147
147
floor: 2 ,
148
- employees: 18
148
+ employees: 18 ,
149
149
},
150
150
kids: [
151
151
{
152
152
data: {
153
- name: ' Origenes Maxwell' ,
154
- phone: ' 345892' ,
155
- hire_date: ' February 1, 2004' ,
156
- id: 6234
153
+ name: " Origenes Maxwell" ,
154
+ phone: " 345892" ,
155
+ hire_date: " February 1, 2004" ,
156
+ id: 6234 ,
157
157
},
158
- kids: []
159
- }
160
- ]
158
+ kids: [],
159
+ },
160
+ ],
161
161
},
162
162
{
163
163
data: {
164
- department: ' testing' ,
165
- supervisor: ' Zekeriya Seok' ,
164
+ department: " testing" ,
165
+ supervisor: " Zekeriya Seok" ,
166
166
floor: 4 ,
167
- employees: 11
167
+ employees: 11 ,
168
168
},
169
- kids: []
170
- }
171
- ]
169
+ kids: [],
170
+ },
171
+ ],
172
172
},
173
173
{
174
174
data: {
175
- name: ' b2 ' ,
176
- street: ' s10' ,
177
- city: ' c2 ' ,
175
+ name: " b2 " ,
176
+ street: " s10" ,
177
+ city: " c2 " ,
178
178
departments: 3 ,
179
- offices: 10
179
+ offices: 10 ,
180
180
},
181
181
kids: [
182
182
{
183
183
data: {
184
- department: ' development' ,
185
- supervisor: ' Gallagher Howie' ,
184
+ department: " development" ,
185
+ supervisor: " Gallagher Howie" ,
186
186
floor: 8 ,
187
- employees: 24
187
+ employees: 24 ,
188
188
},
189
189
kids: [
190
190
{
191
191
data: {
192
- name: ' Wat Dakota'
192
+ name: " Wat Dakota" ,
193
193
},
194
- kids: []
195
- }
196
- ]
194
+ kids: [],
195
+ },
196
+ ],
197
197
},
198
198
{
199
199
data: {
200
- department: ' testing' ,
201
- supervisor: ' Shirley Gayle' ,
200
+ department: " testing" ,
201
+ supervisor: " Shirley Gayle" ,
202
202
floor: 4 ,
203
- employees: 11
203
+ employees: 11 ,
204
204
},
205
- kids: []
206
- }
207
- ]
205
+ kids: [],
206
+ },
207
+ ],
208
208
},
209
209
{
210
210
data: {
211
- name: ' b3 ' ,
212
- street: ' s3 ' ,
213
- city: ' c3 ' ,
211
+ name: " b3 " ,
212
+ street: " s3 " ,
213
+ city: " c3 " ,
214
214
departments: 2 ,
215
- offices: 1
215
+ offices: 1 ,
216
216
},
217
217
kids: [
218
218
{
219
219
data: {
220
- department: ' development'
220
+ department: " development" ,
221
221
},
222
222
kids: [
223
223
{
224
224
data: {
225
- name: ' Wat Dakota'
225
+ name: " Wat Dakota" ,
226
226
},
227
- kids: []
228
- }
229
- ]
227
+ kids: [],
228
+ },
229
+ ],
230
230
},
231
- {}
232
- ]
231
+ {},
232
+ ],
233
233
},
234
234
235
235
{
236
236
data: {
237
- name: ' b4 ' ,
238
- city: ' c4 '
237
+ name: " b4 " ,
238
+ city: " c4 " ,
239
239
},
240
- kids: []
241
- }
240
+ kids: [],
241
+ },
242
242
];
243
243
244
244
var settings = {
245
245
iDisplayLength: 20 ,
246
246
bLengthChange: false ,
247
247
bFilter: false ,
248
248
bSort: false ,
249
- bInfo: false
249
+ bInfo: false ,
250
250
};
251
251
252
252
var table = new nestedTables.TableHierarchy (
253
- ' example' ,
253
+ " example" ,
254
254
dataInJson,
255
255
settings
256
256
);
@@ -277,51 +277,47 @@ tableEle.addEventListener('onHideChildHierarchy', function(e) {
277
277
var dataInJson2 = [
278
278
{
279
279
data: {
280
- date: ' 2018-08'
280
+ date: " 2018-08" ,
281
281
},
282
282
kids: [
283
283
{
284
284
data: {
285
- ' ' :
286
- ' <input type="checkbox" name="exampleCheckbox" value="exampleCheckbox">' ,
287
- img:
288
- ' <img src=https:\/\/ picsum.photos\/ 100\/ 100 width=20 \/ >' ,
285
+ " " : ' <input type="checkbox" name="exampleCheckbox" value="exampleCheckbox">' ,
286
+ img: " <img src=https:\/\/ picsum.photos\/ 100\/ 100 width=20 \/ >" ,
289
287
like: {
290
288
value: 47 ,
291
- cellClass: ' likeCell' ,
292
- headerClass: ' likeHeader'
289
+ cellClass: " likeCell" ,
290
+ headerClass: " likeHeader" ,
293
291
},
294
- perf: { value: 130.55555555555554 , cellClass: ' perf' },
295
- date: ' 2018-08-30'
292
+ perf: { value: 130.55555555555554 , cellClass: " perf" },
293
+ date: " 2018-08-30" ,
296
294
},
297
- kids: []
295
+ kids: [],
298
296
},
299
297
{
300
298
data: {
301
- ' ' :
302
- ' <input type="checkbox" name="exampleCheckbox2" value="exampleCheckbox2">' ,
303
- img:
304
- ' <img src=https:\/\/ picsum.photos\/ 100\/ 100 width=20 \/ >' ,
299
+ " " : ' <input type="checkbox" name="exampleCheckbox2" value="exampleCheckbox2">' ,
300
+ img: " <img src=https:\/\/ picsum.photos\/ 100\/ 100 width=20 \/ >" ,
305
301
like: 24 ,
306
302
perf: 66.66666666666667 ,
307
- date: ' 2018-08-31'
303
+ date: " 2018-08-31" ,
308
304
},
309
- kids: []
310
- }
311
- ]
312
- }
305
+ kids: [],
306
+ },
307
+ ],
308
+ },
313
309
];
314
310
315
311
var settings = {
316
312
iDisplayLength: 20 ,
317
313
bLengthChange: false ,
318
314
bFilter: false ,
319
315
bSort: false ,
320
- bInfo: false
316
+ bInfo: false ,
321
317
};
322
318
323
319
var table = new nestedTables.TableHierarchy (
324
- ' example' ,
320
+ " example" ,
325
321
dataInJson,
326
322
settings
327
323
);
@@ -334,3 +330,6 @@ tableEle.addEventListener('onHideChildHierarchy', function(e) {
334
330
## License
335
331
336
332
MIT © [ Andrej Gajdos] ( http://andrejgajdos.com )
333
+
334
+ [ Notion Api Connector] ( https://notionapiconnector.com/ )
335
+ [ SalesforceToNotion] ( https://salesforcetonotion.com/ )
0 commit comments