@refinitiv-ui/efx-grid 6.0.118 → 6.0.120

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 (44) hide show
  1. package/lib/core/dist/core.css +1 -1
  2. package/lib/core/dist/core.js +97 -6
  3. package/lib/core/dist/core.min.js +1 -1
  4. package/lib/core/es6/data/DataView.js +7 -5
  5. package/lib/core/es6/grid/Core.js +1 -1
  6. package/lib/core/es6/grid/components/Cell.d.ts +2 -0
  7. package/lib/core/es6/grid/components/Cell.js +89 -0
  8. package/lib/core/es6/tr-grid-theme.js +1 -1
  9. package/lib/filter-dialog/themes/base-checkbox.less +1 -1
  10. package/lib/filter-dialog/themes/elemental/dark/checkbox-list.js +1 -1
  11. package/lib/filter-dialog/themes/elemental/dark/es5/all-elements.js +1 -1
  12. package/lib/filter-dialog/themes/elemental/light/checkbox-list.js +1 -1
  13. package/lib/filter-dialog/themes/elemental/light/es5/all-elements.js +1 -1
  14. package/lib/filter-dialog/themes/halo/dark/checkbox-list.js +1 -1
  15. package/lib/filter-dialog/themes/halo/dark/es5/all-elements.js +1 -1
  16. package/lib/filter-dialog/themes/halo/light/checkbox-list.js +1 -1
  17. package/lib/filter-dialog/themes/halo/light/es5/all-elements.js +1 -1
  18. package/lib/filter-dialog/themes/solar/charcoal/checkbox-list.js +1 -1
  19. package/lib/filter-dialog/themes/solar/charcoal/es5/all-elements.js +1 -1
  20. package/lib/filter-dialog/themes/solar/pearl/checkbox-list.js +1 -1
  21. package/lib/filter-dialog/themes/solar/pearl/es5/all-elements.js +1 -1
  22. package/lib/grid/index.js +1 -1
  23. package/lib/rt-grid/dist/rt-grid.js +292 -109
  24. package/lib/rt-grid/dist/rt-grid.min.js +1 -1
  25. package/lib/rt-grid/es6/ColumnDefinition.js +7 -0
  26. package/lib/rt-grid/es6/Grid.js +145 -83
  27. package/lib/rt-grid/es6/RowDefinition.d.ts +2 -0
  28. package/lib/rt-grid/es6/RowDefinition.js +29 -19
  29. package/lib/tr-grid-auto-tooltip/es6/AutoTooltip.js +18 -15
  30. package/lib/tr-grid-column-grouping/es6/ColumnGrouping.js +6 -1
  31. package/lib/tr-grid-column-stack/es6/ColumnStack.js +2 -1
  32. package/lib/tr-grid-in-cell-editing/es6/InCellEditing.d.ts +2 -2
  33. package/lib/tr-grid-in-cell-editing/es6/InCellEditing.js +11 -6
  34. package/lib/tr-grid-row-dragging/es6/RowDragging.d.ts +0 -2
  35. package/lib/tr-grid-row-dragging/es6/RowDragging.js +82 -77
  36. package/lib/tr-grid-row-selection/es6/RowSelection.js +155 -35
  37. package/lib/tr-grid-util/es6/jet/MockQuotes2.js +13 -0
  38. package/lib/types/es6/AutoTooltip.d.ts +1 -0
  39. package/lib/types/es6/Core/grid/components/Cell.d.ts +2 -0
  40. package/lib/types/es6/InCellEditing.d.ts +2 -2
  41. package/lib/types/es6/RealtimeGrid/RowDefinition.d.ts +2 -0
  42. package/lib/types/es6/RowDragging.d.ts +0 -2
  43. package/lib/versions.json +8 -8
  44. package/package.json +1 -1
@@ -547,6 +547,13 @@ ColumnDefinition.getDataType = function(field) {
547
547
  return "";
548
548
  };
549
549
  /** @public
550
+ * @ignore
551
+ * @return {boolean|string|null}
552
+ */
553
+ ColumnDefinition.prototype.getTooltipValue = function() {
554
+ return this._tooltip;
555
+ };
556
+ /** @public
550
557
  * @return {string}
551
558
  */
552
559
  ColumnDefinition.prototype.getTooltip = function() {
@@ -274,11 +274,11 @@ let _hasFieldOrId = function(colDef, str) {
274
274
  };
275
275
 
276
276
  /** Compare the difference in the 'id' property.
277
- * @private
278
- * @param {Object} obj1
279
- * @param {Object} obj2
280
- * @returns {boolean} If the id property of two objects is equal, the return will be true, otherwise it will be false.
281
- */
277
+ * @private
278
+ * @param {Object} obj1
279
+ * @param {Object} obj2
280
+ * @returns {boolean} If the id property of two objects is equal, the return will be true, otherwise it will be false.
281
+ */
282
282
  let _hasMatchingId = function(obj1, obj2) {
283
283
  if(!obj1 || !obj2 || !obj1.id || !obj2.id) { // Handle nullable, if the object or id have null, it's means difference value
284
284
  return false;
@@ -286,6 +286,25 @@ let _hasMatchingId = function(obj1, obj2) {
286
286
  return obj1.id === obj2.id;
287
287
  };
288
288
 
289
+ /** @private
290
+ * @param {Object} e
291
+ */
292
+ let _preventDefault = function(e) {
293
+ if(e) {
294
+ e.preventDefault();
295
+ }
296
+ };
297
+ /** @private
298
+ * @param {number=} id
299
+ * @returns {number} Always return 0
300
+ */
301
+ let _clearTimeout = function(id) {
302
+ if(id) {
303
+ clearTimeout(id);
304
+ }
305
+ return 0;
306
+ };
307
+
289
308
  /** @constructor
290
309
  * @extends {EventDispatcher}
291
310
  * @param {(Element|null)=} placeholder
@@ -596,10 +615,6 @@ Grid.prototype._topSection = true;
596
615
  * @private
597
616
  */
598
617
  Grid.prototype._focusingArgs = null;
599
- /** @type {number}
600
- * @private
601
- */
602
- Grid.prototype._scrolledRow = -1;
603
618
  /** @type {boolean}
604
619
  * @private
605
620
  */
@@ -614,10 +629,8 @@ Grid.prototype.dispose = function() {
614
629
  clearInterval(this._autoLayoutTimer);
615
630
  this._autoLayoutTimer = 0;
616
631
  }
617
- if(this._pollingTimerId) {
618
- clearTimeout(this._pollingTimerId);
619
- this._pollingTimerId = 0;
620
- }
632
+ this._pollingTimerId = _clearTimeout(this._pollingTimerId);
633
+
621
634
  this.removeAllColumns(); // Some conflators are reset
622
635
  this.removeAllRows(); // Some conflators are reset
623
636
  this._sorter.dispose();
@@ -640,9 +653,8 @@ Grid.prototype.dispose = function() {
640
653
  }
641
654
 
642
655
  if(this._focusingArgs) {
643
- if(this._focusingArgs.id) {
644
- clearTimeout(this._focusingArgs.id);
645
- }
656
+ _clearTimeout(this._focusingArgs.id);
657
+ _clearTimeout(this._focusingArgs.timeoutId);
646
658
  this._focusingArgs = null;
647
659
  }
648
660
  };
@@ -947,6 +959,7 @@ Grid.prototype.initialize = function(gridOption) {
947
959
  this.addListener(gridOption, "beforeContentBinding");
948
960
  this.addListener(gridOption, "firstRendered");
949
961
  this.addListener(gridOption, "afterContentBinding");
962
+ this.addListener(gridOption, "tabNavigation");
950
963
 
951
964
  if(gridOption["autoDateConversion"]) {
952
965
  t._autoDateConversion = true;
@@ -2290,9 +2303,46 @@ Grid.prototype.setColumnSorter = function(colRef, func) {
2290
2303
  * @param {!RowDefinition} rowDef
2291
2304
  */
2292
2305
  Grid.prototype._initDuplicateRicData = function(rowDef) {
2306
+ if(!rowDef) {
2307
+ return;
2308
+ }
2309
+ let rowDefs = this._connector.getRowDefByRic(rowDef.getSymbol());
2310
+ if(rowDefs && rowDefs.length > 0) { // Found at least 1 Duplicate chain/ric data
2311
+ let firstRowDef = rowDefs[0];
2312
+ rowDef.copyRowData(firstRowDef);
2313
+ if(rowDef.isChain()) {
2314
+ let children = firstRowDef.getChildren();
2315
+ if(children && children.length > 0) {
2316
+ setTimeout(this._cloneChain.bind(this, rowDef), 0); // Need to delay to wait row inserted
2317
+ }
2318
+ }
2319
+ }
2320
+ };
2321
+
2322
+ /** @private
2323
+ * @param {Object} rowDef
2324
+ * @param {Array<Object>} children
2325
+ */
2326
+ Grid.prototype._cloneChain = function(rowDef) {
2293
2327
  let rowDefs = this._connector.getRowDefByRic(rowDef.getSymbol());
2294
- if(rowDefs) {
2295
- rowDef.copyRowData(rowDefs[0]);
2328
+ let firstRowDef = rowDefs ? rowDefs[0] : null;
2329
+ let constituents = firstRowDef ? firstRowDef.getChildren() : null;
2330
+
2331
+ if(!constituents) {
2332
+ return;
2333
+ }
2334
+ let count = constituents.length;
2335
+ if(count < 0 ) {
2336
+ return;
2337
+ }
2338
+
2339
+ let subId = rowDef.getData(SUB_ID);
2340
+ for (let i = 0; i < count; i++) {
2341
+ let childRowDef = constituents[i];
2342
+ let rowData = childRowDef.cloneRowData();
2343
+ rowData["SUB_ID"] = subId;
2344
+ let rid = subId + rowData["RIC"];
2345
+ this._dc.setRowData(rid, rowData);
2296
2346
  }
2297
2347
  };
2298
2348
  /** @public
@@ -3426,12 +3476,15 @@ Grid.prototype._renderColumnHeader = function(colIndex, arg) {
3426
3476
  let colName = colDef.getName();
3427
3477
  let colTooltip = colDef.getTooltip();
3428
3478
  let headerAlignment = colDef.getHeaderAlignment();
3479
+ let tooltipValue = colDef.getTooltipValue();
3429
3480
 
3430
3481
  for(let r = 0; r < rowCount; ++r) {
3431
3482
  let tCell = tSection.getCell(colIndex, r, false);
3432
3483
  // Default behaviors
3433
3484
  tCell.setContent(colName);
3434
- tCell.setTooltip(colTooltip);
3485
+ tCell.setTooltipInfo("columnDefault", tooltipValue);
3486
+ tCell.setTooltipInfo("columnTooltip", colTooltip);
3487
+ tCell.updateTooltip();
3435
3488
  tCell.setStyle("textAlign", headerAlignment);
3436
3489
 
3437
3490
  if(customRenderer) {
@@ -4179,38 +4232,49 @@ Grid.prototype.getVScrollView = function () {
4179
4232
  return this._grid.getVScrollView();
4180
4233
  };
4181
4234
 
4182
- /** @private
4183
- * @param {Element} el
4184
- * @return {boolean}
4185
- */
4186
- function isFocusableContent(el) {
4187
- if(el) {
4188
- return (el.tagName !== "SPAN" && !el.disabled);
4189
- }
4190
- return false;
4191
- }
4192
4235
  /** @private
4193
4236
  * @param {Object} cell
4237
+ * @param {Object} args
4194
4238
  * @return {boolean}
4195
4239
  */
4196
- function focusCell(cell) {
4240
+ Grid.prototype._focusCell = function(cell, args) {
4197
4241
  if(cell) {
4198
4242
  let cellContent = cell.getContent();
4199
- if(cellContent && isFocusableContent(cellContent)) {
4200
- cellContent.focus();
4201
- return true;
4243
+ if(cellContent) {
4244
+ let nfe = null;
4245
+ if(this.hasListener("tabNavigation")) {
4246
+ let tabNavArg = {
4247
+ "shiftKey": args.shiftKey,
4248
+ "activeElement": args.activeElement,
4249
+ "cellContent": cellContent,
4250
+ "cell": cell,
4251
+ "colIndex": args.colIndex,
4252
+ "rowIndex": args.rowIndex,
4253
+ "field": args.fields ? args.fields[args.colIndex] : ""
4254
+ };
4255
+ this._dispatch("tabNavigation", tabNavArg);
4256
+ nfe = tabNavArg.nextFocusableElement;
4257
+ } else if(cellContent.tagName !== "SPAN") {
4258
+ nfe = cellContent;
4259
+ }
4260
+
4261
+ if(nfe && nfe !== args.activeElement && !nfe.disabled) {
4262
+ nfe.focus();
4263
+ return true;
4264
+ }
4202
4265
  }
4203
4266
  }
4204
4267
  return false;
4205
- }
4268
+ };
4206
4269
  /** @private
4207
4270
  */
4208
4271
  Grid.prototype._onVScroll = function() {
4209
4272
  let args = this._focusingArgs;
4210
4273
  if(args) {
4274
+ args.timeoutId = _clearTimeout(args.timeoutId);
4211
4275
  this._focusingArgs = null;
4212
4276
  let cell = this._grid.getCell("content", args.colIndex, args.rowIndex);
4213
- if(!focusCell(cell)) {
4277
+ if(!this._focusCell(cell, args)) {
4214
4278
  if(args.shiftKey) {
4215
4279
  this._focusPrevCellContent(args);
4216
4280
  } else {
@@ -4221,6 +4285,11 @@ Grid.prototype._onVScroll = function() {
4221
4285
  };
4222
4286
  /** @private
4223
4287
  */
4288
+ Grid.prototype._onScrollTimeout = function() {
4289
+ this._focusingArgs = null;
4290
+ };
4291
+ /** @private
4292
+ */
4224
4293
  Grid.prototype._selfScrollToRow = function() {
4225
4294
  let args = this._focusingArgs;
4226
4295
  if(args) {
@@ -4230,20 +4299,14 @@ Grid.prototype._selfScrollToRow = function() {
4230
4299
  };
4231
4300
  /** @private
4232
4301
  * @param {Object} args
4233
- * @param {number} colIndex
4234
- * @param {number} rowIndex
4235
4302
  */
4236
- Grid.prototype._requestScroll = function(args, colIndex, rowIndex) {
4237
- if(this._focusingArgs || this._scrolledRow === args.rowIndex) {
4238
- return; // Avoid infinite loop
4303
+ Grid.prototype._requestScroll = function(args) {
4304
+ if(!this._focusingArgs) {
4305
+ this._focusingArgs = args;
4306
+ args.event = null; // The event is invalid after the scroll
4307
+ args.id = setTimeout(this._selfScrollToRow, 0); // Avoid event loop protection
4308
+ args.timeoutId = setTimeout(this._onScrollTimeout, 100); // To avoid a fail case where scroll cannot be performed
4239
4309
  }
4240
-
4241
- this._scrolledRow = args.rowIndex;
4242
- this._focusingArgs = args;
4243
- args.colIndex = colIndex;
4244
- args.rowIndex = rowIndex;
4245
- args.event = null; // The event is invalid after the scroll
4246
- args.id = setTimeout(this._selfScrollToRow); // Avoid event loop protection
4247
4310
  };
4248
4311
  /** @private
4249
4312
  * @param {Object} args
@@ -4267,28 +4330,27 @@ Grid.prototype._focusNextCellContent = function(args) {
4267
4330
  startIdx = i;
4268
4331
  }
4269
4332
  }
4270
- // If the current focus is on a valid content, starts on the next cell
4271
- if(args.event && args.validContent) {
4272
- startIdx++;
4273
- }
4274
4333
 
4275
4334
  let grid = this._grid;
4276
4335
  let section = grid.getSection("content");
4277
4336
  let viewInfo = grid.getVerticalViewInfo();
4278
4337
  let lastFullRow = viewInfo.lastFullRow;
4279
4338
  let rowCount = this.getRowCount();
4339
+
4340
+ args.fields = grid.getColumnFields();
4280
4341
  for(let r = rowIndex; r < rowCount; r++) {
4342
+ args.rowIndex = r;
4281
4343
  for(i = startIdx; i < len; i++) {
4282
4344
  let c = focusableColIndices[i];
4345
+ args.colIndex = c;
4283
4346
  if(r > lastFullRow) {
4284
- this._requestScroll(args, c, r);
4347
+ _preventDefault(args.event);
4348
+ this._requestScroll(args);
4285
4349
  return;
4286
4350
  } else {
4287
4351
  let cell = section.getCell(c, r);
4288
- if(focusCell(cell)) {
4289
- if(args.event) {
4290
- args.event.preventDefault();
4291
- }
4352
+ if(this._focusCell(cell, args)) {
4353
+ _preventDefault(args.event);
4292
4354
  return;
4293
4355
  }
4294
4356
  }
@@ -4296,9 +4358,8 @@ Grid.prototype._focusNextCellContent = function(args) {
4296
4358
  startIdx = 0;
4297
4359
  }
4298
4360
 
4299
- if(args.validContent) { // The current focus on the last focusable content
4300
- this._grid.getHiddenInput().focus();
4301
- }
4361
+ // The current focus on the last focusable content
4362
+ this._grid.getHiddenInput().focus();
4302
4363
  };
4303
4364
  /** @private
4304
4365
  * @param {Object} args
@@ -4322,27 +4383,26 @@ Grid.prototype._focusPrevCellContent = function(args) {
4322
4383
  startIdx = i;
4323
4384
  }
4324
4385
  }
4325
- // If the current focus is on a valid content, starts on the next cell
4326
- if(args.event && args.validContent) {
4327
- --startIdx;
4328
- }
4329
4386
 
4330
4387
  let grid = this._grid;
4331
4388
  let section = grid.getSection("content");
4332
4389
  let viewInfo = grid.getVerticalViewInfo();
4333
4390
  let firstFullRow = viewInfo.firstFullRow;
4391
+
4392
+ args.fields = this.getColumnFields();
4334
4393
  for(let r = rowIndex; r >= 0; r--) {
4394
+ args.rowIndex = r;
4335
4395
  for(i = startIdx; i >= 0; i--) {
4336
4396
  let c = focusableColIndices[i];
4397
+ args.colIndex = c;
4337
4398
  if(r < firstFullRow) {
4338
- this._requestScroll(args, c, r);
4399
+ _preventDefault(args.event);
4400
+ this._requestScroll(args);
4339
4401
  return;
4340
4402
  } else {
4341
4403
  let cell = section.getCell(c, r);
4342
- if(focusCell(cell)) {
4343
- if(args.event) {
4344
- args.event.preventDefault();
4345
- }
4404
+ if(this._focusCell(cell, args)) {
4405
+ _preventDefault(args.event);
4346
4406
  return;
4347
4407
  }
4348
4408
  }
@@ -4350,15 +4410,18 @@ Grid.prototype._focusPrevCellContent = function(args) {
4350
4410
  startIdx = len - 1;
4351
4411
  }
4352
4412
 
4353
- if(args.validContent) { // The current focus on the last focusable content
4354
- this._grid.getHiddenInput(true).focus();
4355
- }
4413
+ // The current focus on the last focusable content
4414
+ this._grid.getHiddenInput(true).focus();
4356
4415
  };
4357
4416
 
4358
4417
  /** @private
4359
4418
  * @param {Object} e
4360
4419
  */
4361
4420
  Grid.prototype._onTabNavigation = function(e) {
4421
+ if(this._focusingArgs) {
4422
+ return; // Cannot do another tab navigation while waiting for scrolling
4423
+ }
4424
+
4362
4425
  let colDefs = this.getColumnDefinitions();
4363
4426
  let colCount = colDefs.length;
4364
4427
 
@@ -4373,19 +4436,8 @@ Grid.prototype._onTabNavigation = function(e) {
4373
4436
  return;
4374
4437
  }
4375
4438
 
4376
- this._scrolledRow = -1; // Reset the scroll loop protector
4377
4439
  let keyEvt = e.event;
4378
4440
  let pos = this.getRelativePosition(keyEvt);
4379
- let validContent = true;
4380
- let activeElement = e.activeElement;
4381
- if(activeElement) {
4382
- validContent = !activeElement.classList.contains("valigner");
4383
- }
4384
-
4385
- if(validContent) {
4386
- let content = pos["cell"] ? pos["cell"].getContent() : null;
4387
- validContent = isFocusableContent(content);
4388
- }
4389
4441
  let startingRowIndex = pos["rowIndex"];
4390
4442
  if(e.onTheEdge) {
4391
4443
  let viewInfo = this._grid.getVerticalViewInfo();
@@ -4397,7 +4449,7 @@ Grid.prototype._onTabNavigation = function(e) {
4397
4449
  colIndex: pos["colIndex"],
4398
4450
  rowIndex: startingRowIndex,
4399
4451
  focusableColIndices: focusableColIndices,
4400
- validContent: validContent
4452
+ activeElement: e.activeElement
4401
4453
  };
4402
4454
 
4403
4455
  if(keyEvt.shiftKey) {
@@ -4407,5 +4459,15 @@ Grid.prototype._onTabNavigation = function(e) {
4407
4459
  }
4408
4460
  };
4409
4461
 
4462
+ /** @public
4463
+ * @ignore
4464
+ * @return {!Object}
4465
+ */
4466
+ Grid.prototype._getEventHandlers = function() {
4467
+ return {
4468
+ "tabNavigation": this._onTabNavigation
4469
+ };
4470
+ };
4471
+
4410
4472
  export { Grid };
4411
4473
  export default Grid;
@@ -64,6 +64,8 @@ declare class RowDefinition {
64
64
 
65
65
  public copyRowData(srcRowDef: RowDefinition|null): void;
66
66
 
67
+ public cloneRowData(obj?: any, exceptionObj?: any): any;
68
+
67
69
  public setRowData(data: { [key: string]: any }): void;
68
70
 
69
71
  public setData(field: string, value: any): void;
@@ -704,28 +704,38 @@ RowDefinition.prototype.updateRowData = function(data, indexToFieldMap) {
704
704
  */
705
705
  RowDefinition.prototype.copyRowData = function(srcRowDef) {
706
706
  if(srcRowDef && srcRowDef !== this) {
707
- let field;
708
- let uncopiable_fields = {
709
- "ROW_DEF": 1,
710
- "SUB_ID": 1
711
- };
712
- let staticValues = this._staticValues;
713
- for(field in staticValues) {
714
- uncopiable_fields[field] = 1;
715
- }
716
- staticValues = srcRowDef._staticValues;
717
- for(field in staticValues) {
718
- uncopiable_fields[field] = 1;
719
- }
720
-
721
- let srcRowData = srcRowDef.getRowData();
722
707
  let rowData = this.getRowData();
723
- for(field in srcRowData) {
724
- if(!uncopiable_fields[field]) {
725
- rowData[field] = srcRowData[field]; // There is no dataChanged event fired
726
- }
708
+ srcRowDef.cloneRowData(rowData, this._staticValues);
709
+ }
710
+ };
711
+ /** @public
712
+ * @param {Object=} obj
713
+ * @param {Object=} exceptionObj
714
+ * @return {!Object}
715
+ */
716
+ RowDefinition.prototype.cloneRowData = function(obj, exceptionObj) {
717
+ let rowObj = obj || {};
718
+ let field;
719
+ let uncopiable_fields = {
720
+ "ROW_DEF": 1,
721
+ "SUB_ID": 1
722
+ };
723
+ let staticValues = this._staticValues;
724
+ for(field in staticValues) {
725
+ uncopiable_fields[field] = 1;
726
+ }
727
+
728
+ for(field in exceptionObj) {
729
+ uncopiable_fields[field] = 1;
730
+ }
731
+
732
+ let rowData = this.getRowData();
733
+ for(field in rowData) {
734
+ if(!uncopiable_fields[field]) {
735
+ rowObj[field] = rowData[field];
727
736
  }
728
737
  }
738
+ return rowObj;
729
739
  };
730
740
  /** @public
731
741
  * @param {Object.<string, *>} data
@@ -417,28 +417,31 @@ AutoTooltipPlugin.prototype._updateNonContentSection = function (section, colInd
417
417
  var elem = cell.getContent();
418
418
  if(!elem) { return false; }
419
419
 
420
- // Set tooltip only if text's length is longer than column width.
421
- var tooltip = cell.getAttribute("tooltip") || cell.getTooltip();
420
+ var tooltipInfo = cell.getTooltipInfo();
421
+ if(tooltipInfo) {
422
+ if(tooltipInfo["userTooltip"] != null ||
423
+ tooltipInfo["groupHeaderDefault"] != null ||
424
+ tooltipInfo["columnDefault"] != null) {
425
+
426
+ cell.setTooltipInfo("clippedText", false);
427
+ cell.removeAttribute("ef-title");
428
+ continue;
429
+ }
430
+ }
422
431
 
432
+ // Set tooltip only if text's length is longer than column width.
423
433
  var sw = elem.scrollWidth;
424
434
  if(sw && sw > elem.offsetWidth) {
425
- if(!tooltip) {
426
- tooltip = cell.getTextContent(); // TODO: Allow custom tooltip text
427
- cell._autoTooltip = true;
428
- }
429
- } else {
430
- if(cell._autoTooltip) {
431
- tooltip = "";
432
- cell._autoTooltip = false;
433
- }
434
- }
435
+ cell.setTooltipInfo("clippedText", true);
435
436
 
436
- cell.setTooltip(tooltip); // TODO: Avoiding using getter and setter in the same loop
437
- if(tooltip) {
438
- cell.setAttribute("ef-title", tooltip); // to make sure ef-title value will actually change
437
+ var tooltip = cell.getTextContent();
438
+ cell.setTooltipInfo("clippedTextTooltip", tooltip);
439
+ cell.setAttribute("ef-title", tooltip);
439
440
  } else {
441
+ cell.setTooltipInfo("clippedText", false);
440
442
  cell.removeAttribute("ef-title");
441
443
  }
444
+ cell.updateTooltip();
442
445
  }
443
446
  return true;
444
447
  };
@@ -516,6 +516,9 @@ ColumnGroupingPlugin.prototype._applyGrouping = function () {
516
516
  cell.removeClass("no-sort");
517
517
  cell.removeClass("selected-group");
518
518
  cell.removeAttribute("group-id");
519
+ cell.setTooltipInfo("groupHeaderDefault", false);
520
+ cell.setTooltipInfo("groupHeaderTooltip", null);
521
+ cell.updateTooltip();
519
522
  }
520
523
  }
521
524
  }
@@ -909,7 +912,9 @@ ColumnGroupingPlugin.prototype._renderGroup = function(groupDef, section) {
909
912
  if(cell) {
910
913
  // Overide the defaults
911
914
  cell.setStyle("text-align", groupDef["alignment"] || "");
912
- cell.setTooltip(ColumnGroupingPlugin._getTooltip(groupDef));
915
+ cell.setTooltipInfo("groupHeaderDefault", groupDef["tooltip"]);
916
+ cell.setTooltipInfo("groupHeaderTooltip", ColumnGroupingPlugin._getTooltip(groupDef));
917
+ cell.updateTooltip();
913
918
  cell.setContent(groupDef["name"] || groupDef["title"]);
914
919
 
915
920
  // Additional cell settings must be removed in the _applyGrouping() method
@@ -297,7 +297,8 @@ ColumnStackPlugin._styles = prettifyCss([
297
297
  "cursor: pointer;" // change the mouse cursor on the collapsed stack icon to allow for expansion but disallow sorting
298
298
  ],
299
299
  ".tr-grid .collapsed .cell.grouping .floating-panel .stack-icon", [
300
- "margin-left: 0;"
300
+ "margin-left: 0;",
301
+ "margin-right: 0;"
301
302
  ],
302
303
  ".stack-icon", [
303
304
  "color: var(--grid-title-filter-icon-color);"
@@ -106,9 +106,9 @@ declare class InCellEditingPlugin extends GridPlugin {
106
106
 
107
107
  public isColumnEditable(colIndex: number): boolean;
108
108
 
109
- public enableReadonly(bool: boolean): void;
109
+ public enableReadonly(enabled?: boolean|null): void;
110
110
 
111
- public disableReadonly(bool: boolean): void;
111
+ public disableReadonly(disabled?: boolean|null): void;
112
112
 
113
113
  public openRowEditor(rowIndex: number, grid?: any): void;
114
114
 
@@ -1387,17 +1387,22 @@ InCellEditingPlugin.prototype.isColumnEditable = function (colIndex) {
1387
1387
 
1388
1388
  /**
1389
1389
  * @public
1390
- * @param {boolean} bool
1390
+ * @param {boolean=} enabled
1391
1391
  */
1392
- InCellEditingPlugin.prototype.enableReadonly = function (bool) {
1393
- this._readonly = bool !== false;
1392
+ InCellEditingPlugin.prototype.enableReadonly = function (enabled) {
1393
+ this._readonly = enabled !== false;
1394
+ if(this._readonly) {
1395
+ this._updateStaterText(false);
1396
+ } else {
1397
+ this._updateStaterText();
1398
+ }
1394
1399
  };
1395
1400
  /**
1396
1401
  * @public
1397
- * @param {boolean} bool
1402
+ * @param {boolean=} disabled
1398
1403
  */
1399
- InCellEditingPlugin.prototype.disableReadonly = function () {
1400
- this.enableReadonly(false);
1404
+ InCellEditingPlugin.prototype.disableReadonly = function (disabled) {
1405
+ this.enableReadonly(disabled === false);
1401
1406
  };
1402
1407
  /** @public
1403
1408
  * @description Supply an keyboard input. This is for testing purpose.
@@ -73,8 +73,6 @@ declare class RowDraggingPlugin extends GridPlugin {
73
73
 
74
74
  public setJETDragContent(content: any): void;
75
75
 
76
- public setJETDragContent(content: any): void;
77
-
78
76
  }
79
77
 
80
78
  export default RowDraggingPlugin;