EXTJS4,tabpanel和网格设置,用网格rowclick打开新选项卡。它会覆盖每个旧选项卡

发布于 2025-01-01 23:58:56 字数 626 浏览 0 评论 0原文

我实际上有两个问题,我会尝试分别解决它们。我有一个选项卡面板,Tab1 中有一个网格。当选项卡面板打开时,Tab1 中的网格将填充来自对数据库的 AJAX 调用的数据。 Tab1 没有关闭选项,因此网格保持填充并打开。我有一个 rowEditor 设置,这样当双击网格中的一行时,它会打开一个新选项卡,并使用一个新网格填充新选项卡,显示 Tab1 中网格中单击的记录项的详细内容。

现在,如果我双击 Tab1 中网格中的一条记录,则会打开一个新选项卡 (Tab2),并且单击的记录详细信息会填充到 Tab2 网格中,并且工作正常。现在,如果我单击 Tab1 中网格中的另一条记录,则会打开一个新选项卡 (Tab3),并填充从 Tab1 单击的该记录的详细结果。现在的问题是 Tab3 打开,Tab3 的结果覆盖了 Tab2 中的结果。我填充到 tab2 中的数据去了哪里,如何确保每个新的详细记录都显示在创建的每个新选项卡中?看起来每个打开的新选项卡都在每个新选项卡上附加新数据,并且我正在被覆盖。

理想情况下,我希望在 Tab1 中打开带有记录索引的网格,并且每次双击记录都会打开一个新的选项卡面板,其中单击该记录的详细结果。

我的第二个问题是,当我关闭选项卡时,我发现 Tab1 中的网格正在刷新,而我没有告诉它刷新。结果,我收到错误,因为我没有传递 Tab1 中的网格刷新所需的参数。

I am actually having 2 problems, and I will try to address them separately. I have a tabpanel, with a Grid in Tab1. When the tabpanel opens the Grid in Tab1 is populated with data from an AJAX call to a database. Tab1 does not have a close option, so the Grid stays populated and open. I have a rowEditor setup so that when a row in the Grid is double-clicked it opens a new Tab and populates the new tab with a new grid showing detailed content for the clicked record item in the grid from Tab1.

Now, if I double-click a record in the Grid from Tab1, a new tab opens (Tab2) and the details for the record clicked populate in the Tab2 Grid and it works fine. Now if I click another record in the Grid in Tab1, a new tab opens (Tab3) and it populates with detail results for that record clicked from Tab1. Problem is now that Tab3 is open the results for Tab3 have overwritten the results in Tab2. Where has the data I populated into tab2 gone, and how can I make sure to have each new detail record show in each new tab created? It looks like each new tab that is opening is appending the new data on each new tab, and I am getting overwrites.

Ideally I want to have the Grid in Tab1 open with an index of records and each double click on a record opens a new tabpanel with the detail results for that record clicked.

My second problem is that when I close a tab I am finding that the grid in Tab1 is refreshing when I am not telling it to refresh. as a result I am getting errors because I am not passing required parameters for the Grid in Tab1 to refresh.

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

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

发布评论

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

评论(1

淑女气质 2025-01-08 23:58:56

我的猜测是,您从多个选项卡引用了相同的商店或相同的网格配置。相反,您想要做的是在您打开的每个选项卡中拥有网格和商店的单独实例。这样就不会发生碰撞。

选项卡更改时网格重新加载的问题很奇怪,因为这不是默认行为。检查您的选项卡面板配置和侦听器是否有任何过度的重新加载。

My guess is that you have references to the same stores or the same grid config from multiple tabs. Instead what you want to do is to have separate instances of both the grids and the stores in each tab that you open. That way you wont have collisions.

The issue with the grid reloading on tab change is strange as that is not the default behavior. Check your tabpanel config and listeners for any overzealous reloads.

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