Is it possible to get the data by 'griddleKey'?
See original GitHub issueGriddle version
^1.10.0
Problem
So I’m using my own RowEnhancer
, so I can implement my own onClick
, like this:
const components: GriddleComponents = {
RowEnhancer: (OriginalRow: GriddleComponent<GriddleRowProps>) => (props: GriddleRowProps) => (
<OriginalRow
{...props}
onClick={() => {
console.log(`Clicked Row ${props.griddleKey}`);
console.log('props', props);
}}
/>
),
};
When I click on the row, I get the following log:
Click Row 32
props {griddleKey: 32, columnIds: Array(3), className: "griddle-row", Cell: ƒ}
The griddleKey
here would be useful to get al the row-data back I guess, but I can’t seem to find out how this should be done. 😕
Can somebody help me please?
Issue Analytics
- State:
- Created 6 years ago
- Comments:15 (6 by maintainers)
Top Results From Across the Web
ReactJS - Griddle v1.0 get current filtered data - Stack Overflow
Im trying to figure out how to get the current filtered items from the Griddle component. I found the following function in the...
Read more >Get data from Row into Cell | Griddle
Griddle supports getting data from Row into Cell. First we need two helpers: row data selector and connect-wrapper: import { connect } from...
Read more >[Solved]-Selecting a Row in React Griddle, and changing tr ...
setState({ selectedRowId: row.props.data.id }); } render() { const ... I'm assuming that something must have changed in Griddle over the past two years....
Read more >How to create a customized data grid using griddle-react
You can just change the component rendered from App to change the components according to the tutorial. All code snippets will also be...
Read more >DynamicTyped - Bountysource
I got griddle going with external data using the sample wrapper that you provided ... Is there a way to have a custom...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@MichaelDeBoey take a look at https://codesandbox.io/s/r50q23027o.
You’re using
rowDataSelector
in a context that has access to your app store rather than Griddle’s internal store; you need to use the selector inside a<Griddle />
and withutils.connect
(or simply{ connect } from 'griddle-react'
, as of #751).I did mess up my example slightly;
EnhanceWithRowData
needs to becompose
d. It also occurs to me thatwithHandlers
is a better way to createonClick
:You’ll get better performance using the
rowDataSelector
that’s exported from Griddle (via our Storybook). You can also simplify your enhancer usingrecompose/mapProps
: