gregnb / gregnb/mui-datatables

Can you bind the value of a column to a boolean property?

Open
#1,528 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
2.7k
Forks
905
PR merge metrics
No merged PRs in 30d

Description

Should I be able to bind a column directly to a boolean property like this?

  const columns: MUIDataTableColumn[] = [
    {
      name: 'name',
      label: 'I am a string',
    },
    {
      name: 'isPrimary',
      label: 'I am a boolean',
    },
  ];

Because when I do that, the column has blanks. If I map my object so that isPrimary is a string (Y,N) then they appear.

Also, when binding to a boolean, the filter select correctly shows All, True, False but when I select True, the little chip above the grid is empty.

So basically, can you not bind direct to a boolean?

Contributor guide

No contributing guide indexed for this repository

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

Reproduce the issue using the column definitions and boolean data shown in the report, then trace the table rendering and filter-chip behavior. Done means boolean values display in the column and the selected True or False filter is represented by a non-empty chip.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.