MCPcopy Create free account
hub / github.com/Autodesk/react-base-table / reset

Method reset

src/ColumnManager.js:15–31  ·  view source on GitHub ↗
(columns, fixed)

Source from the content-addressed store, hash-verified

13 }
14
15 reset(columns, fixed) {
16 this._columns = columns.map(column => {
17 let width = column.width;
18 if (column.resizable) {
19 // don't reset column's `width` if `width` prop doesn't change
20 const idx = this._origColumns.findIndex(x => x.key === column.key);
21 if (idx >= 0 && this._origColumns[idx].width === column.width) {
22 width = this._columns[idx].width;
23 }
24 }
25 return { ...column, width };
26 });
27 this._origColumns = columns;
28 this._fixed = fixed;
29 this._cached = {};
30 this._columnStyles = this.recomputeColumnStyles();
31 }
32
33 resetCache() {
34 this._cached = {};

Callers 2

constructorMethod · 0.95
constructorMethod · 0.80

Calls 1

recomputeColumnStylesMethod · 0.95

Tested by

no test coverage detected