PDA

View Full Version : Need help in Nested Ajaxtabs



vidya
10-28-2008, 03:00 PM
1) Script Title: Help required in Nested Ajaxtabs

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex17/ajaxtabscontent/index.htm

3) Describe problem: Please visit my site www.sreedesaienterprises.com where i have implemented your Nested Ajax Tabs Content script v2.2. Please go to Central Excise>Notifications. Here you will see two tabs:1) Non Tariff and 2) Tariff. I am not able to load the external files (cex_nt_notfn.html and cex_t_notfn.html respectively) in these two tabs. As you can see if i click Non Tariff/Tariff i am taken to a new window. I want the content to appear within the divcontainer meant for the each of the tabs: Non Tariff and Tariff separately. As you can also see the "loading content" script is also not functioning. Please help. Thanks in advance.

ddadmin
10-28-2008, 05:43 PM
It seems you have 3 levels deep of Ajax tabs in this case, so:

1)Central Excise > 2) Notifications > 3) Non Tariff

For each level, you'll need to define a new instance variable, and hook the "onajaxload" event to that variable. You only have two right now. The correct way to do a 3 levels tabs is something like:


var ajaxtabs=new ddajaxtabs("ajaxtabs", "ajaxdivcontainer")
ajaxtabs.setpersist(true)
ajaxtabs.setselectedClassTarget("link") //"link" or "linkparent"
ajaxtabs.init()

ajaxtabs.onajaxpageload=function(pageurl){
if (pageurl.indexOf("central_excise.html")!=-1){
var centralexcisetabs=new ddajaxtabs("centralexcisetabs", "centralexcisedivcontainer")
centralexcisetabs.setpersist(true)
centralexcisetabs.setselectedClassTarget("link") //"link" or "linkparent"
centralexcisetabs.init()
centralexcisetabs.onajaxpageload=function(pageurl){
if (pageurl.indexOf("notifications.html")!=-1){
var notificationstabs=new ddajaxtabs("notificationstabs", "notificationsdivcontainer")
notificationstabs.setpersist(true)
notificationstabs.setselectedClassTarget("link") //"link" or "linkparent"
notificationstabs.init()
}
if (pageurl.indexOf("service_tax.html")!=-1){
var servicetaxtabs=new ddajaxtabs("servicetaxtabs", "servicetaxdivcontainer")
servicetaxtabs.setpersist(true)
servicetaxtabs.setselectedClassTarget("link") //"link" or "linkparent"
servicetaxtabs.init()
}
}
}

The above is untested, so you'll want to check for any errors. But the basic idea is there.
}

vidya
10-31-2008, 06:22 PM
Hello Sir,
I am very grateful for your prompt reply on my post. Words can not justify how much i am grateful to you for your directions. The code indeed contained one error i.e., the position of some of the code was to be different. I have corrected the same and is as follows:
var ajaxtabs=new ddajaxtabs("ajaxtabs", "ajaxdivcontainer")
ajaxtabs.setpersist(true)
ajaxtabs.setselectedClassTarget("link") //"link" or "linkparent"
ajaxtabs.init()

ajaxtabs.onajaxpageload=function(pageurl){
if (pageurl.indexOf("central_excise.html")!=-1){
var centralexcisetabs=new ddajaxtabs("centralexcisetabs", "centralexcisedivcontainer")
centralexcisetabs.setpersist(true)
centralexcisetabs.setselectedClassTarget("link") //"link" or "linkparent"
centralexcisetabs.init()
}
if (pageurl.indexOf("service_tax.html")!=-1){
var servicetaxtabs=new ddajaxtabs("servicetaxtabs", "servicetaxdivcontainer")
servicetaxtabs.setpersist(true)
servicetaxtabs.setselectedClassTarget("link") //"link" or "linkparent"
servicetaxtabs.init()
}
centralexcisetabs.onajaxpageload=function(pageurl){
if (pageurl.indexOf("notifications.html")!=-1){
var notificationstabs=new ddajaxtabs("notificationstabs", "notificationsdivcontainer")
notificationstabs.setpersist(true)
notificationstabs.setselectedClassTarget("link") //"link" or "linkparent"
notificationstabs.init()
}
}
}
The 3rd level tabs are now working thanks to your prompt help. Please check it out! If you need any help i will gratefully help you. Thanks once again!