table icon indicating copy to clipboard operation
table copied to clipboard

Column definition from json file

Open mg629 opened this issue 6 years ago • 1 comments

I am using react-table version ^7.0.0-rc.9. I have json files that describe the columns for each of my different tables.

Table1Columns.json contains // Example Column definition { "Header": "Column 1 name", "accessor": "column_1_name",
}

I fetch the column data from the json files.
The fields "Header" and "accessor" work fine and my columns contain the correct header and data but when I try to set any other fields in the column definition like "width" or "filterable". The "width" and "filterable" fields are ignored.

Table1Columns.json contains // Example Column definition { "Header": "Column 1 name", "accessor": "column_1_name",
"filterable": "false", "width": "50" }

What might I be doing wrong?

mg629 avatar Jan 29 '20 14:01 mg629

I figured out my issue. Once I added useBlockLayout I was able to get the "width" field to work. And for the "filterable", I needed to use "Filter" and "filter".

mg629 avatar Jan 29 '20 16:01 mg629