{
header: “Seller Price”,
accessorKey: “sellerPrice”,
enableSorting: true,
Cell: ({ cell }: any) => (
{cell?.getValue()}
)
},
{
header: “MRP”,
accessorKey: “maxRetailPrice”,
enableSorting: true,
Cell: ({ cell }: any) => (
{cell?.getValue()}
)
},
const table = useMaterialReactTable({
columns,
data: attributeData,
enableStickyHeader: true,
enableDensityToggle: false,
enableHiding: true,
enableFilters: false,
enableColumnFilters: false,
enableFullScreenToggle: false,
manualPagination: true,
enableStickyFooter: true,
enableColumnResizing: true,
layoutMode: “grid”,
initialState: {
columnPinning: { left: [“name”], right: [“actions”] },
columnVisibility: {
sellerPrice: false,
maxRetailPrice: false
}
},
onPaginationChange: setPaginationModel,
rowCount: totalRows,
state: { pagination: paginationModel, isLoading: tableLoading },
………….
}
i’ve set column visibility false for the 2 columns, and the get hidden when you first load the table, but when you make them visible, it shows the column entirely blank.
Tanishqa S is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.