JQuery UI Tabs - Clear Cached Tab

随声附和 提交于 2019-12-01 21:52:49

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/8797486/jquery-ui-tabs-clear-cached-tab

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!