tabulator-tables 5.3.1 → 5.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/bower.json +1 -1
  2. package/dist/css/tabulator_bootstrap3.css +1 -1
  3. package/dist/css/tabulator_bootstrap3.css.map +1 -1
  4. package/dist/css/tabulator_bootstrap3.min.css +1 -1
  5. package/dist/css/tabulator_bootstrap3.min.css.map +1 -1
  6. package/dist/css/tabulator_bootstrap4.css +4 -4
  7. package/dist/css/tabulator_bootstrap4.css.map +1 -1
  8. package/dist/css/tabulator_bootstrap4.min.css +1 -1
  9. package/dist/css/tabulator_bootstrap4.min.css.map +1 -1
  10. package/dist/css/tabulator_bootstrap5.css +4 -4
  11. package/dist/css/tabulator_bootstrap5.css.map +1 -1
  12. package/dist/css/tabulator_bootstrap5.min.css +1 -1
  13. package/dist/css/tabulator_bootstrap5.min.css.map +1 -1
  14. package/dist/js/tabulator.js +225 -216
  15. package/dist/js/tabulator.js.map +1 -1
  16. package/dist/js/tabulator.min.js +2 -2
  17. package/dist/js/tabulator.min.js.map +1 -1
  18. package/dist/js/tabulator_esm.js +379 -377
  19. package/dist/js/tabulator_esm.js.map +1 -1
  20. package/dist/js/tabulator_esm.min.js +2 -2
  21. package/dist/js/tabulator_esm.min.js.map +1 -1
  22. package/package.json +1 -1
  23. package/src/js/core/ColumnManager.js +7 -3
  24. package/src/js/core/Module.js +54 -23
  25. package/src/js/core/RowManager.js +81 -94
  26. package/src/js/core/Tabulator.js +2 -2
  27. package/src/js/core/tools/InteractionMonitor.js +9 -8
  28. package/src/js/modules/DataTree/DataTree.js +0 -10
  29. package/src/js/modules/FrozenRows/FrozenRows.js +3 -2
  30. package/src/js/modules/GroupRows/Group.js +3 -7
  31. package/src/js/modules/GroupRows/GroupComponent.js +1 -1
  32. package/src/js/modules/GroupRows/GroupRows.js +200 -200
  33. package/src/js/modules/Interaction/Interaction.js +1 -1
  34. package/src/js/modules/Page/Page.js +2 -12
  35. package/src/js/modules/Persistence/Persistence.js +3 -2
  36. package/src/js/modules/SelectRow/SelectRow.js +8 -4
  37. package/src/js/modules/Sort/Sort.js +4 -7
  38. package/src/scss/themes/bootstrap/tabulator_bootstrap3.scss +1 -1
  39. package/src/scss/themes/bootstrap/tabulator_bootstrap4.scss +1 -1
  40. package/src/scss/themes/bootstrap/tabulator_bootstrap5.scss +1 -1
@@ -3,20 +3,19 @@ import Module from '../../core/Module.js';
3
3
  import Group from './Group.js';
4
4
 
5
5
  class GroupRows extends Module{
6
-
6
+
7
7
  constructor(table){
8
8
  super(table);
9
-
9
+
10
10
  this.groupIDLookups = false; //enable table grouping and set field to group by
11
11
  this.startOpen = [function(){return false;}]; //starting state of group
12
12
  this.headerGenerator = [function(){return "";}];
13
13
  this.groupList = []; //ordered list of groups
14
14
  this.allowedValues = false;
15
15
  this.groups = {}; //hold row groups
16
- this.displayIndex = 0; //index in display pipeline
17
-
16
+
18
17
  this.displayHandler = this.getRows.bind(this);
19
-
18
+
20
19
  //register table options
21
20
  this.registerTableOption("groupBy", false); //enable table grouping and set field to group by
22
21
  this.registerTableOption("groupStartOpen", true); //starting state of group
@@ -29,7 +28,7 @@ class GroupRows extends Module{
29
28
  this.registerTableOption("groupHeaderDownload", null);
30
29
  this.registerTableOption("groupToggleElement", "arrow");
31
30
  this.registerTableOption("groupClosedShowCalcs", false);
32
-
31
+
33
32
  //register table functions
34
33
  this.registerTableFunction("setGroupBy", this.setGroupBy.bind(this));
35
34
  this.registerTableFunction("setGroupValues", this.setGroupValues.bind(this));
@@ -37,11 +36,11 @@ class GroupRows extends Module{
37
36
  this.registerTableFunction("setGroupHeader", this.setGroupHeader.bind(this));
38
37
  this.registerTableFunction("getGroups", this.userGetGroups.bind(this));
39
38
  this.registerTableFunction("getGroupedData", this.userGetGroupedData.bind(this));
40
-
39
+
41
40
  //register component functions
42
41
  this.registerComponentFunction("row", "getGroup", this.rowGetGroup.bind(this));
43
42
  }
44
-
43
+
45
44
  //initialize group configuration
46
45
  initialize(){
47
46
  if(this.table.options.groupBy){
@@ -49,7 +48,7 @@ class GroupRows extends Module{
49
48
  this.subscribe("cell-value-updated", this.cellUpdated.bind(this));
50
49
  this.subscribe("row-data-changed", this.reassignRowToGroup.bind(this), 0);
51
50
  }
52
-
51
+
53
52
  this.subscribe("table-built", this.configureGroupSetup.bind(this));
54
53
 
55
54
  this.subscribe("row-deleting", this.rowDeleting.bind(this));
@@ -59,73 +58,73 @@ class GroupRows extends Module{
59
58
  this.subscribe("rows-added", this.rowsUpdated.bind(this));
60
59
  this.subscribe("row-moving", this.rowMoving.bind(this));
61
60
  this.subscribe("row-adding-index", this.rowAddingIndex.bind(this));
62
-
61
+
63
62
  this.subscribe("rows-sample", this.rowSample.bind(this));
64
-
63
+
65
64
  this.subscribe("render-virtual-fill", this.virtualRenderFill.bind(this));
66
-
65
+
67
66
  this.registerDisplayHandler(this.displayHandler, 20);
68
-
67
+
69
68
  this.initialized = true;
70
69
  }
71
70
  }
72
-
71
+
73
72
  configureGroupSetup(){
74
73
  if(this.table.options.groupBy){
75
74
  var groupBy = this.table.options.groupBy,
76
75
  startOpen = this.table.options.groupStartOpen,
77
76
  groupHeader = this.table.options.groupHeader;
78
-
77
+
79
78
  this.allowedValues = this.table.options.groupValues;
80
-
79
+
81
80
  if(Array.isArray(groupBy) && Array.isArray(groupHeader) && groupBy.length > groupHeader.length){
82
81
  console.warn("Error creating group headers, groupHeader array is shorter than groupBy array");
83
82
  }
84
-
83
+
85
84
  this.headerGenerator = [function(){return "";}];
86
85
  this.startOpen = [function(){return false;}]; //starting state of group
87
-
86
+
88
87
  this.langBind("groups|item", (langValue, lang) => {
89
88
  this.headerGenerator[0] = (value, count, data) => { //header layout function
90
89
  return (typeof value === "undefined" ? "" : value) + "<span>(" + count + " " + ((count === 1) ? langValue : lang.groups.items) + ")</span>";
91
90
  };
92
91
  });
93
-
92
+
94
93
  this.groupIDLookups = [];
95
-
94
+
96
95
  if(Array.isArray(groupBy)){
97
96
  if(this.table.modExists("columnCalcs") && this.table.options.columnCalcs != "table" && this.table.options.columnCalcs != "both"){
98
97
  this.table.modules.columnCalcs.removeCalcs();
99
98
  }
100
99
  }else{
101
100
  if(this.table.modExists("columnCalcs") && this.table.options.columnCalcs != "group"){
102
-
101
+
103
102
  var cols = this.table.columnManager.getRealColumns();
104
-
103
+
105
104
  cols.forEach((col) => {
106
105
  if(col.definition.topCalc){
107
106
  this.table.modules.columnCalcs.initializeTopRow();
108
107
  }
109
-
108
+
110
109
  if(col.definition.bottomCalc){
111
110
  this.table.modules.columnCalcs.initializeBottomRow();
112
111
  }
113
112
  });
114
113
  }
115
114
  }
116
-
115
+
117
116
  if(!Array.isArray(groupBy)){
118
117
  groupBy = [groupBy];
119
118
  }
120
-
119
+
121
120
  groupBy.forEach((group, i) => {
122
121
  var lookupFunc, column;
123
-
122
+
124
123
  if(typeof group == "function"){
125
124
  lookupFunc = group;
126
125
  }else{
127
126
  column = this.table.columnManager.getColumnByField(group);
128
-
127
+
129
128
  if(column){
130
129
  lookupFunc = function(data){
131
130
  return column.getFieldValue(data);
@@ -136,26 +135,26 @@ class GroupRows extends Module{
136
135
  };
137
136
  }
138
137
  }
139
-
138
+
140
139
  this.groupIDLookups.push({
141
140
  field: typeof group === "function" ? false : group,
142
141
  func:lookupFunc,
143
142
  values:this.allowedValues ? this.allowedValues[i] : false,
144
143
  });
145
144
  });
146
-
145
+
147
146
  if(startOpen){
148
147
  if(!Array.isArray(startOpen)){
149
148
  startOpen = [startOpen];
150
149
  }
151
-
150
+
152
151
  startOpen.forEach((level) => {
153
152
  level = typeof level == "function" ? level : function(){return true;};
154
153
  });
155
-
154
+
156
155
  this.startOpen = startOpen;
157
156
  }
158
-
157
+
159
158
  if(groupHeader){
160
159
  this.headerGenerator = Array.isArray(groupHeader) ? groupHeader : [groupHeader];
161
160
  }
@@ -164,218 +163,215 @@ class GroupRows extends Module{
164
163
  this.groups = {};
165
164
  }
166
165
  }
167
-
166
+
168
167
  rowSample(rows, prevValue){
169
- var group = this.getGroups(false)[0];
170
-
171
- prevValue.push(group.getRows(false)[0]);
172
-
168
+ if(this.table.options.groupBy){
169
+ var group = this.getGroups(false)[0];
170
+
171
+ prevValue.push(group.getRows(false)[0]);
172
+ }
173
+
173
174
  return prevValue;
174
175
  }
175
-
176
+
176
177
  virtualRenderFill(){
177
178
  var el = this.table.rowManager.tableElement;
178
179
  var rows = this.table.rowManager.getVisibleRows();
179
-
180
- rows = rows.filter((row) => {
181
- return row.type !== "group";
182
- });
183
-
184
- el.style.minWidth = !rows.length ? this.table.columnManager.getWidth() + "px" : "";
185
-
186
- // if(this.table.options.groupBy){
187
- // if(this.layoutMode() != "fitDataFill" && rowsCount == this.table.modules.groupRows.countGroups()){
188
- // el.style.minWidth = this.table.columnManager.getWidth() + "px";
189
- // }
190
- // }
180
+
181
+ if(this.table.options.groupBy){
182
+ rows = rows.filter((row) => {
183
+ return row.type !== "group";
184
+ });
185
+
186
+ el.style.minWidth = !rows.length ? this.table.columnManager.getWidth() + "px" : "";
187
+ }else{
188
+ return rows;
189
+ }
191
190
  }
192
-
191
+
193
192
  rowAddingIndex(row, index, top){
194
- this.assignRowToGroup(row);
195
-
196
- var groupRows = row.modules.group.rows;
197
-
198
- if(groupRows.length > 1){
199
- if(!index || (index && groupRows.indexOf(index) == -1)){
200
- if(top){
201
- if(groupRows[0] !== row){
202
- index = groupRows[0];
203
- this.table.rowManager.moveRowInArray(row.modules.group.rows, row, index, !top);
193
+ if(this.table.options.groupBy){
194
+ this.assignRowToGroup(row);
195
+
196
+ var groupRows = row.modules.group.rows;
197
+
198
+ if(groupRows.length > 1){
199
+ if(!index || (index && groupRows.indexOf(index) == -1)){
200
+ if(top){
201
+ if(groupRows[0] !== row){
202
+ index = groupRows[0];
203
+ this.table.rowManager.moveRowInArray(row.modules.group.rows, row, index, !top);
204
+ }
205
+ }else{
206
+ if(groupRows[groupRows.length -1] !== row){
207
+ index = groupRows[groupRows.length -1];
208
+ this.table.rowManager.moveRowInArray(row.modules.group.rows, row, index, !top);
209
+ }
204
210
  }
205
211
  }else{
206
- if(groupRows[groupRows.length -1] !== row){
207
- index = groupRows[groupRows.length -1];
208
- this.table.rowManager.moveRowInArray(row.modules.group.rows, row, index, !top);
209
- }
212
+ this.table.rowManager.moveRowInArray(row.modules.group.rows, row, index, !top);
210
213
  }
211
- }else{
212
- this.table.rowManager.moveRowInArray(row.modules.group.rows, row, index, !top);
213
214
  }
215
+
216
+ return index;
214
217
  }
215
-
216
- return index;
217
218
  }
218
-
219
+
219
220
  trackChanges(){
220
221
  this.dispatch("group-changed");
221
222
  }
222
-
223
+
223
224
  ///////////////////////////////////
224
225
  ///////// Table Functions /////////
225
226
  ///////////////////////////////////
226
-
227
+
227
228
  setGroupBy(groups){
228
229
  this.table.options.groupBy = groups;
229
-
230
+
230
231
  if(!this.initialized){
231
232
  this.initialize();
232
233
  }
233
-
234
+
234
235
  this.configureGroupSetup();
235
-
236
+
236
237
  this.refreshData();
237
-
238
+
238
239
  this.trackChanges();
239
240
  }
240
-
241
+
241
242
  setGroupValues(groupValues){
242
243
  this.table.options.groupValues = groupValues;
243
244
  this.configureGroupSetup();
244
245
  this.refreshData();
245
-
246
+
246
247
  this.trackChanges();
247
248
  }
248
-
249
+
249
250
  setGroupStartOpen(values){
250
251
  this.table.options.groupStartOpen = values;
251
252
  this.configureGroupSetup();
252
-
253
+
253
254
  if(this.table.options.groupBy){
254
255
  this.refreshData();
255
-
256
+
256
257
  this.trackChanges();
257
258
  }else{
258
259
  console.warn("Grouping Update - cant refresh view, no groups have been set");
259
260
  }
260
261
  }
261
-
262
+
262
263
  setGroupHeader(values){
263
264
  this.table.options.groupHeader = values;
264
265
  this.configureGroupSetup();
265
-
266
+
266
267
  if(this.table.options.groupBy){
267
268
  this.refreshData();
268
-
269
+
269
270
  this.trackChanges();
270
271
  }else{
271
272
  console.warn("Grouping Update - cant refresh view, no groups have been set");
272
273
  }
273
274
  }
274
-
275
+
275
276
  userGetGroups(values){
276
277
  return this.getGroups(true);
277
278
  }
278
-
279
+
279
280
  // get grouped table data in the same format as getData()
280
281
  userGetGroupedData(){
281
- return this.table.options.groupBy ?
282
- this.getGroupedData() : this.getData();
282
+ return this.table.options.groupBy ? this.getGroupedData() : this.getData();
283
283
  }
284
-
285
-
284
+
285
+
286
286
  ///////////////////////////////////////
287
287
  ///////// Component Functions /////////
288
288
  ///////////////////////////////////////
289
-
289
+
290
290
  rowGetGroup(row){
291
291
  return row.modules.group ? row.modules.group.getComponent() : false;
292
292
  }
293
-
293
+
294
294
  ///////////////////////////////////
295
295
  ///////// Internal Logic //////////
296
296
  ///////////////////////////////////
297
-
297
+
298
298
  rowMoving(from, to, after){
299
- if(!after && to instanceof Group){
300
- to = this.table.rowManager.prevDisplayRow(from) || to;
301
- }
302
-
303
- var toGroup = to instanceof Group ? to : to.modules.group;
304
- var fromGroup = from instanceof Group ? from : from.modules.group;
305
-
306
- if(toGroup === fromGroup){
307
- this.table.rowManager.moveRowInArray(toGroup.rows, from, to, after);
308
- }else{
309
- if(fromGroup){
310
- fromGroup.removeRow(from);
299
+ if(this.table.options.groupBy){
300
+ if(!after && to instanceof Group){
301
+ to = this.table.rowManager.prevDisplayRow(from) || to;
302
+ }
303
+
304
+ var toGroup = to instanceof Group ? to : to.modules.group;
305
+ var fromGroup = from instanceof Group ? from : from.modules.group;
306
+
307
+ if(toGroup === fromGroup){
308
+ this.table.rowManager.moveRowInArray(toGroup.rows, from, to, after);
309
+ }else{
310
+ if(fromGroup){
311
+ fromGroup.removeRow(from);
312
+ }
313
+
314
+ toGroup.insertRow(from, to, after);
311
315
  }
312
-
313
- toGroup.insertRow(from, to, after);
314
316
  }
315
317
  }
316
-
317
-
318
+
319
+
318
320
  rowDeleting(row){
319
321
  //remove from group
320
- if(row.modules.group){
322
+ if(this.table.options.groupBy && row.modules.group){
321
323
  row.modules.group.removeRow(row);
322
324
  }
323
325
  }
324
-
325
-
326
+
326
327
  rowsUpdated(row){
327
- this.updateGroupRows(true);
328
+ if(this.table.options.groupBy){
329
+ this.updateGroupRows(true);
330
+ }
328
331
  }
329
-
332
+
330
333
  cellUpdated(cell){
331
- this.reassignRowToGroup(cell.row);
332
- }
333
-
334
-
335
- setDisplayIndex(index){
336
- this.displayIndex = index;
337
- }
338
-
339
- getDisplayIndex(){
340
- return this.displayIndex;
334
+ if(this.table.options.groupBy){
335
+ this.reassignRowToGroup(cell.row);
336
+ }
341
337
  }
342
-
338
+
343
339
  //return appropriate rows with group headers
344
340
  getRows(rows){
345
341
  if(this.table.options.groupBy && this.groupIDLookups.length){
346
-
342
+
347
343
  this.dispatchExternal("dataGrouping");
348
-
344
+
349
345
  this.generateGroups(rows);
350
-
346
+
351
347
  if(this.subscribedExternal("dataGrouped")){
352
348
  this.dispatchExternal("dataGrouped", this.getGroups(true));
353
349
  }
354
-
350
+
355
351
  return this.updateGroupRows();
356
-
352
+
357
353
  }else{
358
354
  return rows.slice(0);
359
355
  }
360
356
  }
361
-
357
+
362
358
  getGroups(component){
363
359
  var groupComponents = [];
364
-
360
+
365
361
  this.groupList.forEach(function(group){
366
362
  groupComponents.push(component ? group.getComponent() : group);
367
363
  });
368
-
364
+
369
365
  return groupComponents;
370
366
  }
371
-
367
+
372
368
  getChildGroups(group){
373
369
  var groupComponents = [];
374
-
370
+
375
371
  if(!group){
376
372
  group = this;
377
373
  }
378
-
374
+
379
375
  group.groupList.forEach((child) => {
380
376
  if(child.groupList.length){
381
377
  groupComponents = groupComponents.concat(this.getChildGroups(child));
@@ -383,91 +379,93 @@ class GroupRows extends Module{
383
379
  groupComponents.push(child);
384
380
  }
385
381
  });
386
-
382
+
387
383
  return groupComponents;
388
384
  }
389
-
385
+
390
386
  wipe(){
391
- this.groupList.forEach(function(group){
392
- group.wipe();
393
- });
387
+ if(this.table.options.groupBy){
388
+ this.groupList.forEach(function(group){
389
+ group.wipe();
390
+ });
391
+ }
394
392
  }
395
-
393
+
396
394
  pullGroupListData(groupList) {
397
395
  var groupListData = [];
398
-
396
+
399
397
  groupList.forEach((group) => {
400
398
  var groupHeader = {};
401
399
  groupHeader.level = 0;
402
400
  groupHeader.rowCount = 0;
403
401
  groupHeader.headerContent = "";
404
402
  var childData = [];
405
-
403
+
406
404
  if (group.hasSubGroups) {
407
405
  childData = this.pullGroupListData(group.groupList);
408
-
406
+
409
407
  groupHeader.level = group.level;
410
408
  groupHeader.rowCount = childData.length - group.groupList.length; // data length minus number of sub-headers
411
409
  groupHeader.headerContent = group.generator(group.key, groupHeader.rowCount, group.rows, group);
412
-
410
+
413
411
  groupListData.push(groupHeader);
414
412
  groupListData = groupListData.concat(childData);
415
413
  }
416
-
414
+
417
415
  else {
418
416
  groupHeader.level = group.level;
419
417
  groupHeader.headerContent = group.generator(group.key, group.rows.length, group.rows, group);
420
418
  groupHeader.rowCount = group.getRows().length;
421
-
419
+
422
420
  groupListData.push(groupHeader);
423
-
421
+
424
422
  group.getRows().forEach((row) => {
425
423
  groupListData.push(row.getData("data"));
426
424
  });
427
425
  }
428
426
  });
429
-
427
+
430
428
  return groupListData;
431
429
  }
432
-
430
+
433
431
  getGroupedData(){
434
-
432
+
435
433
  return this.pullGroupListData(this.groupList);
436
434
  }
437
-
435
+
438
436
  getRowGroup(row){
439
437
  var match = false;
440
-
438
+
441
439
  if(this.options("dataTree")){
442
440
  row = this.table.modules.dataTree.getTreeParentRoot(row);
443
441
  }
444
-
442
+
445
443
  this.groupList.forEach((group) => {
446
444
  var result = group.getRowGroup(row);
447
-
445
+
448
446
  if(result){
449
447
  match = result;
450
448
  }
451
449
  });
452
-
450
+
453
451
  return match;
454
452
  }
455
-
453
+
456
454
  countGroups(){
457
455
  return this.groupList.length;
458
456
  }
459
-
457
+
460
458
  generateGroups(rows){
461
459
  var oldGroups = this.groups;
462
-
460
+
463
461
  this.groups = {};
464
462
  this.groupList = [];
465
-
463
+
466
464
  if(this.allowedValues && this.allowedValues[0]){
467
465
  this.allowedValues[0].forEach((value) => {
468
466
  this.createGroup(value, 0, oldGroups);
469
467
  });
470
-
468
+
471
469
  rows.forEach((row) => {
472
470
  this.assignRowToExistingGroup(row, oldGroups);
473
471
  });
@@ -477,53 +475,53 @@ class GroupRows extends Module{
477
475
  });
478
476
  }
479
477
  }
480
-
478
+
481
479
  createGroup(groupID, level, oldGroups){
482
480
  var groupKey = level + "_" + groupID,
483
481
  group;
484
-
482
+
485
483
  oldGroups = oldGroups || [];
486
-
484
+
487
485
  group = new Group(this, false, level, groupID, this.groupIDLookups[0].field, this.headerGenerator[0], oldGroups[groupKey]);
488
-
486
+
489
487
  this.groups[groupKey] = group;
490
488
  this.groupList.push(group);
491
489
  }
492
-
490
+
493
491
  assignRowToExistingGroup(row, oldGroups){
494
492
  var groupID = this.groupIDLookups[0].func(row.getData()),
495
493
  groupKey = "0_" + groupID;
496
-
494
+
497
495
  if(this.groups[groupKey]){
498
496
  this.groups[groupKey].addRow(row);
499
497
  }
500
498
  }
501
-
499
+
502
500
  assignRowToGroup(row, oldGroups){
503
501
  var groupID = this.groupIDLookups[0].func(row.getData()),
504
502
  newGroupNeeded = !this.groups["0_" + groupID];
505
-
503
+
506
504
  if(newGroupNeeded){
507
505
  this.createGroup(groupID, 0, oldGroups);
508
506
  }
509
-
507
+
510
508
  this.groups["0_" + groupID].addRow(row);
511
-
509
+
512
510
  return !newGroupNeeded;
513
511
  }
514
-
512
+
515
513
  reassignRowToGroup(row){
516
514
  if(row.type === "row"){
517
515
  var oldRowGroup = row.modules.group,
518
516
  oldGroupPath = oldRowGroup.getPath(),
519
517
  newGroupPath = this.getExpectedPath(row),
520
518
  samePath;
521
-
519
+
522
520
  // figure out if new group path is the same as old group path
523
521
  samePath = (oldGroupPath.length == newGroupPath.length) && oldGroupPath.every((element, index) => {
524
522
  return element === newGroupPath[index];
525
523
  });
526
-
524
+
527
525
  // refresh if they new path and old path aren't the same (aka the row's groupings have changed)
528
526
  if(!samePath) {
529
527
  oldRowGroup.removeRow(row);
@@ -532,79 +530,81 @@ class GroupRows extends Module{
532
530
  }
533
531
  }
534
532
  }
535
-
533
+
536
534
  getExpectedPath(row) {
537
535
  var groupPath = [], rowData = row.getData();
538
-
536
+
539
537
  this.groupIDLookups.forEach((groupId) => {
540
538
  groupPath.push(groupId.func(rowData));
541
539
  });
542
-
540
+
543
541
  return groupPath;
544
542
  }
545
-
543
+
546
544
  updateGroupRows(force){
547
545
  var output = [];
548
-
546
+
549
547
  this.groupList.forEach((group) => {
550
548
  output = output.concat(group.getHeadersAndRows());
551
549
  });
552
-
550
+
553
551
  if(force){
554
552
  this.refreshData(true, this.displayHandler);
555
553
  }
556
-
554
+
557
555
  return output;
558
556
  }
559
-
557
+
560
558
  scrollHeaders(left){
561
- if(this.table.options.renderHorizontal === "virtual"){
562
- left -= this.table.columnManager.renderer.vDomPadLeft;
559
+ if(this.table.options.groupBy){
560
+ if(this.table.options.renderHorizontal === "virtual"){
561
+ left -= this.table.columnManager.renderer.vDomPadLeft;
562
+ }
563
+
564
+ left = left + "px";
565
+
566
+ this.groupList.forEach((group) => {
567
+ group.scrollHeader(left);
568
+ });
563
569
  }
564
-
565
- left = left + "px";
566
-
567
- this.groupList.forEach((group) => {
568
- group.scrollHeader(left);
569
- });
570
570
  }
571
-
571
+
572
572
  removeGroup(group){
573
573
  var groupKey = group.level + "_" + group.key,
574
574
  index;
575
-
575
+
576
576
  if(this.groups[groupKey]){
577
577
  delete this.groups[groupKey];
578
-
578
+
579
579
  index = this.groupList.indexOf(group);
580
-
580
+
581
581
  if(index > -1){
582
582
  this.groupList.splice(index, 1);
583
583
  }
584
584
  }
585
585
  }
586
-
586
+
587
587
  checkBasicModeGroupHeaderWidth(){
588
588
  var element = this.table.rowManager.tableElement,
589
589
  onlyGroupHeaders = true;
590
-
590
+
591
591
  this.table.rowManager.getDisplayRows().forEach((row, index) =>{
592
592
  this.table.rowManager.styleRow(row, index);
593
593
  element.appendChild(row.getElement());
594
594
  row.initialize(true);
595
-
595
+
596
596
  if(row.type !== "group"){
597
597
  onlyGroupHeaders = false;
598
598
  }
599
599
  });
600
-
600
+
601
601
  if(onlyGroupHeaders){
602
602
  element.style.minWidth = this.table.columnManager.getWidth() + "px";
603
603
  }else{
604
604
  element.style.minWidth = "";
605
605
  }
606
606
  }
607
-
607
+
608
608
  }
609
609
 
610
610
  GroupRows.moduleName = "groupRows";