简体   繁体   English

JQuery UI选项卡 - 清除缓存选项卡

[英]JQuery UI Tabs - Clear Cached Tab

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. 我在给定页面上有一组JQuery UI选项卡,并将cache属性设置为true,以减少发出的请求数。 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. 这将删除所有选项卡的缓存,并在它们单击项目时重新缓存。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM