#4979·tabulator

Star header filter defaults to 5 stars instead of matching formatterParams

Author: MetallianFR68Created Sep 26, 2026Updated Sep 26, 2026
LabelsPossible Bug

Star header filter defaults to 5 stars instead of matching formatterParams

##JSFIDDLE

https://jsfiddle.net/75qamdzg/1/

Description

Then a column uses the star formatter with more than five stars, adding a star header filter displays only five stars.

The star editor normally detects the number of stars used by the formatter when it is used on the same column. However, this detection does not work when the editor is used as a header filter.

Tabulator version

6.5.3

Minimal reproduction

javascript
new Tabulator("#example-table", {
    data: [
        { id: 1, rating: 2 },
        { id: 2, rating: 7 },
        { id: 3, rating: 10 },
    ],
    columns: [
        {
            title: "Rating",
            field: "rating",
            formatter: "star",
            formatterParams: {
                stars: 10,
            },
            headerFilter: "star",
        },
    ],
});

Actual behavior

The cells display ten stars, but the header filter displays only five stars.

Expected behavior

The header filter should display the same number of stars as the column formatter—ten in this example.

At a minimum, it would be helpful if the star header filter inherited the stars value from formatterParams when no explicit headerFilterParams.stars value is provided.

Workaround

Duplicating the setting appears to be necessary:

javascript
{
    title: "Rating",
    field: "rating",
    formatter: "star",
    formatterParams: {
        stars: 10,
    },
    headerFilter: "star",
    headerFilterParams: {
        stars: 10,
    },
}

Possible cause

The star editor calculates the maximum number of stars using:

javascript
maxStars =
    element.getElementsByTagName("svg").length ||
    5;

For a normal cell editor, the element may already contain the SVG stars generated by the formatter.

For a header filter, the filter element does not contain the formatter SVGs. Since formatterParams.stars is not inherited by headerFilterParams, the editor falls back to five stars.

Workaround :

javascript
maxStars =
    (editorParams && editorParams.stars) ||
    element.getElementsByTagName("svg").length ||
    5;

Documentation inconsistency

The editing documentation says that the star editor can automatically detect the number of stars when used on a column with the star formatter.

However, the header-filter documentation currently states that star editors are not available as header filters.

Despite that note, headerFilter: "star" is instantiated and is partly functional. It may therefore be preferable to either:

  1. officially support it and inherit the formatter star count;
  2. require headerFilterParams.stars and document this explicitly; or
  3. reject the unsupported header filter with a clear warning instead of silently rendering five stars.

Relevant documentation

Source: tabulator-tables/tabulator