Ext.TabPanel中,如果一个tab项使用了autoLoad的话,只当该tab被激活后加载一次。但在实际使用的时候我们可能需要的是当其激活时,显示的是加载页面的最新信息,如新闻等。那么如何实现呢?
看下面的例子:
var tabs = new Ext.TabPanel({ id:"treeTab", border:false, items:[{ title:"修改密码" },{ title:"用户信息", autoLoad:{ url:"userinfo.jsp", scripts:true }, listeners:{ activate:function(tab){ tab.getUpdater().refresh(); } } }] });
官网API中getUpdater()方法说明:
getUpdater() : Ext.Updater
Get the Ext.Updater for this panel. Enables you to perform Ajax updates of this panel's body.
实现对AJAX内容的更新。
更多用法请参见官网API的