在视图之间传递值

发布于 2024-09-28 02:29:41 字数 313 浏览 2 评论 0原文

我有一个相同类型的项目列表(假设是客人),我将它们显示在列表视图中。通过单击该行,我将能够编辑单个元素。所有元素都有相同的编辑掩码,所以我想调用同一页面并传递参数。 我找到的唯一解决方案是:

<a href="edit-page" onClick="setParameter(32)">Element 32</a>

但实际上我更新了 beforepageshow 上的编辑视图,因此在这种情况下,我有两种独立运行的不同方法来存档此目标。

我想知道是否有一个优雅的解决方案。

谢谢, 切萨雷

I have a list of items of the same type (let's say guests) and i display them in a listview. By clicking on the line I would be able to edit the single element. All the elements have the same editing mask, so i would like to call the same page and pass a parameter.
The only solution that i found it's:

<a href="edit-page" onClick="setParameter(32)">Element 32</a>

But actually I update the edit view on beforepageshow so in this case I have 2 different methods that run independently to archive this goal.

I was wondering if there is an elegant solution.

Thanks,
Cesare

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

幻梦 2024-10-05 02:29:41

不能使用get参数吗?

即: href="edit-page?id=32"

Can you not use a get parameter?

ie: href="edit-page?id=32"

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文