-
Support QuestionIs there an API or approach that I can use to extend or override the cells within the datagrid? Ideally I'd like to make use of the table as is, but have a way to provide the individual cells to display. This would allow me to do custom formatting and styling and make use of bespoke components. Is this supported? |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 2 replies
-
|
There is a custom styles example on the README: |
Beta Was this translation helpful? Give feedback.
-
|
That’s for the link. I’m looking for a way to fully customise cells on an individual basis though. From what I can see in the example, the styling would be table-wide with no ability to target individual cells based on their content. Is there either:
An example of what I’d like to do is a flash of green if a number ticks up and red if it ticks down. As far as I can tell from the docs there’s no way to do this in a targeted manner using styles. |
Beta Was this translation helpful? Give feedback.
-
|
I am looking for this feature/api as well. |
Beta Was this translation helpful? Give feedback.
-
|
You can, e.g. the Magic example, though i defer to @texodus for the level to which this is public API (if any) |
Beta Was this translation helpful? Give feedback.
-
|
I do not understand what is being asked for by "customize cells on an individual basis" or "target individual cells based on their content". You can choose to update all, some or none of the visible cells at your discretion based on a wide-range of metadata provided by Perspective does not generate deltas unless you explicitly request them, which means the datagrid does not provide the delta per cell in the metadata object returned from |
Beta Was this translation helpful? Give feedback.
-
|
Just to expand a little more on this topic: what would be the recommended way to register dynamic formatters in a plugin per-instance of a viewer? I mean, I am working on a generic component that has a perspective grid viewer and I want to format the table rows and cells. But every time I instantiate that table, I may be passing different column settings that may have different "formatters" required, hence I'd like to make them dynamic, e.g.: Then But I have not been able to make this work, as config.plugin_config seems to only return the options accepted by the perspective-viewer-d3fc: |
Beta Was this translation helpful? Give feedback.
I do not understand what is being asked for by "customize cells on an individual basis" or "target individual cells based on their content". You can choose to update all, some or none of the visible cells at your discretion based on a wide-range of metadata provided by
getMeta()per cell, you just iterate through visible cells on each style listener callback and only modify the ones you're interested in, a la any of the style examples @timkpaine linked above. Even@finos/perspective-viewer-datagriditself uses this API from the underlyingregular-tabledatagrid library to do its own styling.Perspective does not generate deltas unless you explicitly request them, which means the datagrid …