-
Hi, thanks for building this data grid, it's great to use and build with. One thing that's a bit harder to use is the adding of custom cells. I've checked your source code for the dropdown cell and I think I can create a new custom cell based on that. But I don't know exactly how to add it to the data grid. Especially when already using the Could you give an example of how to add your own custom cell to the data grid, when using the extra cells package? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Figured it out in the meantime, maybe this is useful for others: Instead of using
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} /> |
Beta Was this translation helpful? Give feedback.
-
This is my favorite kind of thread to wake up to, self solving :) |
Beta Was this translation helpful? Give feedback.
Figured it out in the meantime, maybe this is useful for others:
Instead of using
provideEditor
anddrawCell
you can useuseCustomCells
, 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 theglide-data-grid-cells
package, like so: