This is a migrated thread and some comments may be shown as answers.

Not able to go to window.onload function of the previous tabs

2 Answers 47 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
Pams
Top achievements
Rank 1
Pams asked on 29 Nov 2010, 07:50 PM
I am working with the radtabStrip. I have 2 tabs.
On the button click I am taking to the second tab.
In the first tab I have two divs. Each div has has 2 radiobuttons.
The first div is opened always and when a selection is made in the first radio button set, then only the second div of radiobuttons is opened.
In the first user control.
window.onload = function() {
    debugger
        $('.travelType2Class').hide();
        if (document.getElementById("<% =domestic.ClientID %>").checked == true) {
            $('.travelType2Class').fadeIn();
        }
        if (document.getElementById("<% =international.ClientID %>").checked == true) {
            $('.travelType2Class').fadeIn();
        }
    }

It worked fine. And when I went to second usercontrol, I should allow the user to go to the first tab and change some data in middle.
So, when I try to click on first tab, I am able to see the first div with the checked value correctly. The problem is the second div of radiobuttons is not opened.
I dont know what I should do to make the second div state as open when the tab is clicked.
As, I showed here, I tried in the window.onload, but I see that this event is fired for the first time when the first usercontrol loads and is never fired even when that tab is clicked. I even tried in the OnPreRender() method of ascx page. It is getting fired. In that I tried to make the Div visible state as true.
Nothing is working.
I am stuck with this.
Could any one pls tell me how to solve this.

Thanks in advance.

2 Answers, 1 is accepted

Sort by
0
Dimitar Terziev
Telerik team
answered on 01 Dec 2010, 01:27 PM
Hi Pams,

In order to have onload event fired for every user control that you are using please use the following code:

$telerik.$(document).ready(function() {
     
    //Your code goes here;
 
});

This way the code of every user control will be executed on the onload event.
Note that this event is fired only once when the page is loaded.
I hope this will help.

Best regards,
Dimitar Terziev
the Telerik team
Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
Pams
Top achievements
Rank 1
answered on 02 Dec 2010, 02:47 PM
Hi,
It worked fine.
Thank you.
Tags
TabStrip
Asked by
Pams
Top achievements
Rank 1
Answers by
Dimitar Terziev
Telerik team
Pams
Top achievements
Rank 1
Share this question
or