Skip to content

Commit

Permalink
fix: update key for column resizing preferences
Browse files Browse the repository at this point in the history
this is a temporary measure to ensure column width preferences are persisted
with a key that can be used to retrieve them.
This is only needed until issue#238 is addressed
  • Loading branch information
joelamb committed Sep 25, 2023
1 parent 263d12d commit 03a0fea
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions ember-headless-table/src/-private/preferences.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ class TrackedPreferences {
return [...this.plugins.values()].every((pluginPrefs) => pluginPrefs.isAtDefault);
}

/**
* @param {string} name - this needs to be provided as klass.name, eg ColumnResizing.name
*/
forPlugin(name: string) {
let existing = this.plugins.get(name);

Expand Down
2 changes: 1 addition & 1 deletion ember-headless-table/src/plugins/column-resizing/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ export class TableMeta {
let tablePrefs = this.table.preferences;

for (let column of visibleColumnMetas) {
let existing = tablePrefs.storage.forPlugin('ColumnResizing');
let existing = tablePrefs.storage.forPlugin(ColumnResizing.name);
let columnPrefs = existing.forColumn(column.key);

columnPrefs.set('width', column.width.toString());
Expand Down

0 comments on commit 03a0fea

Please sign in to comment.