简体   繁体   中英

How can i display the table row that just got clicked, on another page?

I'm working on a website where you can see buildings on a map and where users can click on a table row ( 1 ) (where informations about the building is shown) to get redirected to the map page. Additionally, and thats where i'm stuck, the clicked table row should appear on the first page ( 2 ).

So the question is: how can i display the table row that just got clicked, on another page?

thanks for your help!

Pass the index of the row that is clicked as props

Even if it's difficult to answer to this question since it's very generic, I'll try to assume that you are missing the basic approach and need a starting point on how resolve this. Once you clicked on the row, you can pass the data to the new URL. Assuming that you are calling a new page, the row should be wrapped in an anchor element and in this case the data can be passed with a GET request, included in the URL. You can have a look to the W3school website page talking about GET method to learn more about it. If you are trying to do this as a single page application with react instead, start looking at React documentation on how components and props work to pass props down to other components. Hope you find this helpful!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM