vaadin / vaadin/framework

Support column alignment in Grid

Open
#6,019 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Java
Stars
1.8k
Forks
717
Avg merge
2d 6h
Merged PRs (30d)
3

Description

Originally by @Legioth


Column both on the server and the client should have

setAlignment(LEFT/CENTER/RIGHT)

This could be implemented in the DOM using the text-alignCSS property. Instead of assigning this as an inline style, a stylename defined in the theme should be used. Stylenames can be added in e.g. Grid.BodyUpdater.postAttach if the alignment is known during initialization and instead in Grod.BodyUpdater.update for things changed on the fly, though that approach would have a small performance penalty since the method is called while scrolling.

The column's alignment can be passed from the server to the client using a new field in GridColumnState.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with GridColumnState and the Grid.BodyUpdater methods named in the issue, especially postAttach and update. Trace how column state reaches the client and how theme stylenames are assigned. Done means LEFT, CENTER, and RIGHT alignment can be set on the server and reflected in the client Grid, including changes made during scrolling.

Written by the indexing model from the issue text.

Assessment

Tech stack
css, java
Domain
full-stack
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.