0
I created two screens, one has a table using the React-table component that has three columns: code, group and edit button for each row. The other screen has a box with two text boxes where, when clicking the edit button I go to the edit screen and I want the text boxes to render the code and the group name of that line where I clicked. I can already print on the console the specific code and group of each line separately by clicking on the button but I don’t know how I take them to another screen and present them inside the text box in the rendering, how can I do this?
And I pull the code name and group like this:
Cell: (props)=> (
<Link to='EditarGrupo'><button className='modaleditar btn btn-info'
onClick={() => {
const nome_cdgrupo = props.original.Cdgrupo;
const nome_grupo = props.original.Grupos;
console.log("Código:", nome_cdgrupo);
console.log("Grupo:", nome_grupo);
}}>
Editar
</button>
</Link>
I want to send the name_group and name_cdgroup to these inputs on another screen:
<input type='text' className='Cdgrupo_edit' defaultValue={this.props.Cdgrupo} onChange={this.handleChangeCdgrupo}></input>
<input type='text' className='Grupos' defaultValue={this.state.Grupo} onChange={this.handleChangeGrupos}></input>
Table information comes from an api, in JSON.
These are the images of how the table is created and the box, where I want to take the code and group to these text boxes, each a different screen:
Hidden problem didn’t explain what it really does and how it has this information. Complicated understanding your problem could explain where this information comes from
– novic
@Virgilionovic Sorry if I wasn’t clear, I’m still quite beginner. I tried to improve my question and put images showing what I’m doing.
– Gabriel Midão