| Page 1 of 1 | [ 4 posts ] |
|
I have a problem with programmatically updating a tab's datasrc . In a nutshell, I am using the YAHOO.plugin.Dispatcher to dynamically load my non-cachable tabs, and each tab has a CGI as its underlying datasrc. I'd like to be able to dynamically update the datasrc before moving from one tab to the next - i.e. catching one of the tab change events and adjusting the datasrc for the soon to be active tab.
I've tried the following code: Code: var tabView = new YAHOO.widget.TabView({id: 'myTabView'}); // tabs added here tabView.subscribe('beforeActiveIndexChange',function (e) { var newTabIndex = e.newValue; var newTab = tabView.getTab(newTabIndex); var newDS= newTab.get('dataSrc'); newDS += "?foo=bar"; newTab.set('dataSrc', newDS); var ds1 = newTab.get('dataSrc'); console.log("ds1: " + ds1); return true; }); The console log shows that the datasrc has indeed changed, but the old datasrc is still used for the actual HTTP request? Anybody have an idea of what I am doing wrong? Regards, Steve |
|
Hello Steve,
You have two options: 1 - You can turn on cache for tab, and you will be able to change the src. This is because the tab uses a property called "dataLoaded" to keep track of the loading process for non-cachable tabs, and this property is defined as "writeOnce". Even if you change the value of dataSrc, dataLoaded will be true after the first loading process, and it will never load the content again, no matter what. 2 - You can use the dispatcher directly to load the content for the tab. So, you can define the tab without dataSrc, and use dispatcher.fetch to load the content of the tab. Something like this: Code: var tabView = new YAHOO.widget.TabView({id: 'myTabView'}); // tabs added here tabView.subscribe('beforeActiveIndexChange',function (e) { var newTabIndex = e.newValue; var newTab = tabView.getTab(newTabIndex); YAHOO.plugin.Dispatcher.fetch (newTab.get('contentEl'), url, {/* more dispatcher config here */}); return true; }); Best Regards, Caridy |
|
Thanks, Caridy. I will try this out today.
Regards, Steve |
|
Hello Caridy,
I am facing this issue can u suggest a way out: I have been trying for the complete day to fix this issue: I have implemented the Yahoo Tab View from existing HTML, I do not require to load the tabs dynamically. Hence I have used to very simple Yahoo TabView using Yahoo APIs 3.5.1 However inside the first tab div I have a div on which I have implemented tooltip feature using jquery also I have the autocomplete text box using jquery. Both of them do not work when inside the tab , if I place them outside of the tab view control they work fine. Can any body suggest me how shld I fix this issue. |
| Page 1 of 1 | [ 4 posts ] |
| You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum |
© 2006-2013 Yahoo! Inc. All rights reserved.
All code on this site is licensed under the BSD License unless stated otherwise.
About This Site · Security Contact Info
Powered by phpBB® Forum Software © phpBB Group