在这种情况下 jQuery 选项卡是否太过分了?

发布于 2024-10-23 17:53:37 字数 262 浏览 1 评论 0原文

我想创建一个带有两个选项卡的内容框。每个选项卡都与一个包含服务器端数据的表相关联。我现在的想法是为每个表加载包含 10 行数据的页面,并分别隐藏/显示每个表以开始。

然后,我将根据选项卡上的单击事件或与正在执行的选项卡式内容相关的 GET 参数(例如,通过分页)来切换选项卡式内容的显示。

我应该只使用 UI 选项卡来处理这个问题,还是在这种情况下切换显示合理?由于用户可以更新他们的数据,我认为通过选项卡 UI 进行缓存在这种情况下没有帮助。

谢谢, 布伦丹

I'd like to create a content box with two tabs. Each tab is associated with a table which contain server-side data. My thought right now is just to load the page with 10 rows worth of data for each table and hide/display each table respectively to begin.

I was then going to toggle display of the tabbed content based on either click events on the tabs OR GET parameters relating to which tabbed content is being acted on (through pagination, for example).

Should I just handle this with UI tabs or is toggling display reasonable in this case? Since the user can update their data, I assume that caching via the tab UI isn't helpful in this case.

Thanks,
Brendan

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

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

发布评论

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

评论(1

摘星┃星的人 2024-10-30 17:53:37

据我了解,我认为这不会太过分。如果你担心性能,2个表10行就20行,这并不算多。每次“点击”分页也会多获得 10 行,所以它仍然很好。

确实通过点击事件使用选项卡激活,但使用 GET 参数来了解用户当前位于哪个页面、来自哪个选项卡。

关于缓存您知道会更改的数据,可能没有必要(请参阅我的第一段)。缓存有时会变得难以处理,因此不要添加不必要的复杂层。

作为建议简单性高于一切的人,我会放弃整个“选项卡加载”的事情,但保留选项卡本身(即将被单击的界面元素),当用户单击每个选项卡时,它会转到另一个页面标签也是,老式风格。

From what I understood, I don't think its going to be overkill. If you are worried about performance, ten rows for 2 tables is just 20, which is not much. Paginating will also get 10 more rows for each 'click' so it's still good there.

Do use tab activation through click events, but also use GET parameters to know in which page the user currently is, from which tab.

Regarding caching data that you know will change, it might be unnecessary (see my 1st paragraph). Caching can sometimes become unwieldy, so don't add an uneccesary layer of complexity.

As someone who suggests simplicity above all else, I'd discard the whole 'tab loading' thing but leaving the tabs per se (i.e. the interface elements that will be clicked) and when the user clicks each tab, it takes to another page with the tabs too, old-fashioned style.

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