Skip to content

Conversation

fahrigedik
Copy link
Member

Updated the table to use default widths when columnWidths are undefined and added canAutoResize binding. Added logic in the component to reset column widths if any are missing, ensuring consistent table rendering.

Description

Resolves https://github.com/volosoft/vs-internal/issues/7259 (write the related issue number if available)

How to test it?

run dev app in volo repo

Updated the table to use default widths when columnWidths are undefined and added canAutoResize binding. Added logic in the component to reset column widths if any are missing, ensuring consistent table rendering.
@fahrigedik fahrigedik added this to the 9.3-patch milestone Sep 1, 2025
Copy link
Contributor

@sumeyyeKurtulus sumeyyeKurtulus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @fahrigedik thank you for coming up with such solution 🙌🏻 it works fine as it should be. However, we can switch to a signal based approach to make it better in terms of scalability and efficiency. Here is an example:

//...
  // Signal for actions column width
  private readonly _actionsColumnWidth = signal<number | undefined>(DEFAULT_ACTIONS_COLUMN_WIDTH);

  @Input() set actionsColumnWidth(width: number) {
    this._actionsColumnWidth.set(width ? Number(width) : undefined);
  }
  readonly columnWidths = computed(() => {
    const actionsColumn = this._actionsColumnWidth();
    const widths = [actionsColumn];
    this.propList.forEach(({ value: prop }) => {
      widths.push(prop.columnWidth);
    });
    return widths;
  });

Replaces manual column width management with Angular signals and computed properties for improved reactivity and code clarity in ExtensibleTableComponent. Removes the setColumnWidths method and updates the actionsColumnWidth input to use a signal.
@yagmurcelk yagmurcelk merged commit 02b4167 into rel-9.3 Sep 2, 2025
2 of 3 checks passed
@yagmurcelk yagmurcelk deleted the issue-#7259 branch September 2, 2025 10:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants