简体   繁体   English

如何在另一个页面上显示刚刚被点击的表格行?

[英]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.我正在一个网站上工作,您可以在该网站上看到 map 上的建筑物,并且用户可以在其中单击表格行 ( 1 )(显示有关建筑物的信息)以重定向到 map 页面。 Additionally, and thats where i'm stuck, the clicked table row should appear on the first page ( 2 ).此外,这就是我被卡住的地方,点击的表格行应该出现在第一页( 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.单击该行后,您可以将数据传递给新的 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.假设您正在调用一个新页面,该行应该包含在一个锚元素中,在这种情况下,数据可以通过 GET 请求传递,包括在 URL 中。 You can have a look to the W3school website page talking about GET method to learn more about it.您可以查看W3school 网站页面,了解有关 GET 方法的更多信息。 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.如果您尝试将其作为单页应用程序来代替,请开始查看 React 文档,了解组件和道具如何工作以将道具传递给其他组件。 Hope you find this helpful!希望你觉得这有帮助!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 单击一行时,如何将“选定”类添加到表的一行? - How can I add a “selected” class to just one row of a table when a row is clicked? 如何将MYSQL表的选定行显示到HTML页面的示例表中? - How can I display the selected row of an MYSQL table into a sample table of an HTML page? 如何获得被点击的表格行的TBODY? - How can I get a clicked table row's TBODY? 如何在与按钮相同的页面中显示表格?表格已经在另一个html文件中组成,所以我只是从那里拉出它们 - How to display table in same page as the button?The tables are already made up in another html file so I’m just pulling them from there 我可以在垫扩展行中显示另一个表吗? - Can I display another table inside mat-expanded row? 如何在 React Js 中仅重新加载表格而不是整个页面 - How can I reload just the table not the whole page in React Js 点击表格tr后,如何在另一个页面上显示这个数据? - After clicking on table tr, how can I display this data on another page? 如何找到我刚刚在JavaScript中单击的行 - How to find which row I just clicked in javascript 除了我刚刚单击的文本字段,如何使整个页面模糊? - How to blur the whole page except the text field I just clicked? 如何在 html 页面中显示行值? - How can I display the row values in html page?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM