Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

react data grid render one character #1662

Closed
pat12345 opened this issue May 17, 2019 · 3 comments
Closed

react data grid render one character #1662

pat12345 opened this issue May 17, 2019 · 3 comments

Comments

@pat12345
Copy link

Hello,

import ReactDataGrid from 'react-data-grid'; const [rows, setRows] = useState([]); const columns = [{ key: "", name: "Code", editable: true }, { key: "delete", name: "Action", editable: false} ]; function loadcode(){ ........service call.... setRows(codes.Tcode.split(',')); } function rowGetterTest(index) { // console.log(rows[index]); return rows[index]; }; return( <ReactDataGrid columns={columns} rowGetter={rowGetterTest} rowsCount={rows.length} rowSelection={true} onGridRowsUpdated={onGridRowsUpdated} />);

I see single character in the data grid.
I also see column names and data grid with two rows (this is expected - but value is single character).
my array looks like this
(2) ["CKT", " RH"]
0: "CKT"
1:" RH"

My datagrid look like below
code Action
K
R

Any idea - why is it not printing whole string?

react version 16.8.4
react data grid 6.1.0

@pat12345
Copy link
Author

I have created function and exactly mimic the format described in this example - of service object and it is working now.
So i am closing this issue.

rarray

rdatagrid

@priyankalxi
Copy link

I am facing same issue , please let me know the solution

@priyankalxi
Copy link

@pat12345 https://github.com/pat12345
I am facing same issue , please let me know the solution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants