Skip to content

How to add new custom cells when using the Extra Cells package? #411

Answered by city17
city17 asked this question in Q&A
Discussion options

You must be logged in to vote

Figured it out in the meantime, maybe this is useful for others:

Instead of using provideEditor and drawCell you can use useCustomCells, which you then spread on the DataEditor component.

useCustomCells takes an array of custom cells, where you can add both your own and the ones from the glide-data-grid-cells package, like so:

import { DataEditor, useCustomCells } from '@glideapps/glide-data-grid';
import { TagsCell } from '@glideapps/glide-data-grid-cells'; // Import each cell from this package individually now

import MyOwnCustomCell from './customCells/MyOwnCustomCell'

const customCells = useCustomCells([TagsCell, MyOwnCustomCell]);

<DataEditor {...customCells} />

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by city17
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants