maclonghorn
Posts: 22
|
| Posted: 03/05/2010, 5:38 AM |
|
I am trying to display a screen with a tabbedview with several tabbedtabs. The first tab has the main information about a property, then the other tabs are the previous years' tax information. So the tabs are:
Property Details
2009
2008
etc
When 2010 data is available in the database, I want to show that tab as well. Is there a way to dynamically generate the next year in a tab?
|
 |
 |
maclonghorn
Posts: 22
|
| Posted: 03/07/2010, 7:27 AM |
|
Anyone have an idea about this?
|
 |
 |
Edigital
Posts: 5
|
| Posted: 03/08/2010, 9:06 AM |
|
I suggest to use this tool instead, dynamic tabs
http://www.codechargetools.com/product.php?product_id=6
Regards
_NJHO
_________________
----------just learning!! |
 |
 |
maclonghorn
Posts: 22
|
| Posted: 03/08/2010, 10:54 AM |
|
How is the CCT tree tool any different from the built-in directory builder in CCS? Plus, I'm looking to generate Yahoo Tabs, not a hierarchical tree structure. That said, I tried inserting a Yahoo Tab View/Tabs in a CCS directory control, but it didn't work. That might be something to pursue though.
Has anyone tried combining these two features?
|
 |
 |
pbrad
Posts: 58
|
| Posted: 03/18/2010, 5:11 AM |
|
Hi,
I don't know if you have resolved this yet but I just did an implementation that was quite similar. I use Yahoo tabs and before showing the page, I fire off an event:
Global $Tpl;
$tab=CCGetParam(tab,'0');
$db = new clsDBWebPort();
$prodid =CCGetParam("product_id","");
$SQL = "SELECT * FROM store_product_tabs WHERE product_id = $prodid ORDER BY tab_index ";
$db->query($SQL);
$code.="<script type='text/javascript'>
(function() {
var tabView = new YAHOO.widget.TabView();";
while($db->next_record() ){
$label = $db->f("tab_label");
$index = $db->f("tab_index");
$content = $db->f("tab_content");
$code.="tabView.addTab( new YAHOO.widget.Tab({
label: '$label',
dataSrc: 'ProductTab.php?product_id=$prodid&tab_index=$index',
cacheData: true,
}));";
}
$code.="\n";
$code.="tabView.addTab( new YAHOO.widget.Tab({
label: 'Send to Friend',
dataSrc: 'SendtoFriend.html',
cacheData: true,
}));";
$code.="tabView.set('activeIndex',$tab);
tabView.appendTo('container');
})();";
$code.="</script>";
$Tpl->setvar("vartest", $code);
The first tabs to be shown are drawn from a table in the database an tabs keep getting built as long as there are related fields, the last tab is always there(Send to Friend) and the content is drawn from an external html table.
Hope this helps,
Pete
_________________
Pete
CCS 4
MySQL
PHP |
 |
 |
maclonghorn
Posts: 22
|
| Posted: 03/23/2010, 6:34 AM |
|
pbrad
Very nice. I thought this might be the way to do it (ie, dynamic javascript) but I wasn't sure how that would work. I'll give this a shot. Thanks for the tip! I would think this would be useful for many others.
|
 |
 |
|