jQuery UI选项卡-清除缓存的选项卡 [英] JQuery UI Tabs - Clear Cached Tab

查看:119
本文介绍了jQuery UI选项卡-清除缓存的选项卡的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在给定页面上具有一组JQuery UI选项卡,并将它们的cache属性设置为true,以减少发出的请求数.选项卡之外还有一个选择列表,用于为加载选项卡的请求提供参数.

I have a set of JQuery UI tabs on a given page and have set the cache property to true for them to reduce the number of requests that are issued. I also have a select list outside of the tabs which is used to provide a parameter to the requests that are made to load the tabs.

问题:如果用户单击所有选项卡并全部加载,然后从选择列表中选择其他项目,则所有选项卡都将显示先前选择的选择选项中的信息.

Problem: If the user clicks all the tabs and all of them load and then selects a different item from the select list, the tabs will all be showing information from the previously selected select option.

当用户从选择列表中选择一个新选项时,我希望能够清除选项卡缓存,以便当他们再次单击选项卡时,缓存中没有任何内容,并且对新选定的选项作为参数提供.

I would like to be able to clear the tab cache when the user selects a new option from the select list so that when they click on the tabs again, there is nothing in the cache and a new request is made with the newly selected option being supplied as a parameter.

有人知道如何清除选项卡的页面缓存吗?

Does anyone know how to clear the page cache for the tabs?

推荐答案

当他们单击其他项目时,只需使用:

When they click on a different item just use:

$("#tabs .ui-tabs-nav a").removeData("cache.tabs");

这将删除所有选项卡的缓存,并且当它们单击项目时将重新缓存.

That will remove the cache for all the tabs and it will recache when they click on items.

这篇关于jQuery UI选项卡-清除缓存的选项卡的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆