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

Add Tab to Parent from RadWindow

4 Answers 120 Views
Window
This is a migrated thread and some comments may be shown as answers.
Kenneth Mazur
Top achievements
Rank 1
Kenneth Mazur asked on 23 Oct 2009, 02:51 AM
I've been trying many different ways to successfully add a tab dynamically to a tabstrip on a parent page from a radwindow.  I will have many RadWindows open from a 1st tabstrip and shown / hidden from that tabstrip.  The first tabstrip will only show the Lists of records in those RadWindows.

I have a 2nd tabstrip that is VerticalLeft that when a user clicks on a record from one of the 1st tabstrip RadWindows, code will execute via JS to 1. Open a new RadWindow showing the details of the record the user selected. and 2. Add a new tab to the 2nd tabstrip on the parent page that will control the showing of the new RadWindows with the details.

I've tried to use the following code, but it errors out on the: var tab = new Telerik.Web.UI.RadTab(); and says: "Object doesn't support this property or method"
                var tabStrip = GetRadWindow().BrowserWindow.OpenItems;
                var tab = Telerik.Web.UI.RadTab();
                tab.set_text("Case: " + id);
                tabStrip.add(tab);

I've tried to use the following code, but it errors out as well saying "No Such Interface Supported".
                GetRadWindow().BrowserWindow().addTab("Testing");

I'm using the following version: 2008, 3, 1314, 20

These should both work as they are spelled out as methods to use to achieve this in the support forums and documentation.  What am I missing?  It's got to be something basic that I'm just not seeing.
Thanks
Ken

4 Answers, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 23 Oct 2009, 06:50 AM
Hello Kenneth,

From the information that you provided, I conclude that the code that you posted here is in the RadWindow's content page. If this is so, your logic will not work and the error is expected - this code should be executed in the main page where the tabstrip is.
Note that the content and the parent page are different, separate pages. If you want to use tabstrip's API to create a new tab, you should create a function in the main page that does that and then call this function from within the RadWindow's content page by using GetRadWindow().BrowserWindow.createTab(); where createTab is the name of the function on the parent page. More information on how to call functions in RadWindows is available here.


Best wishes,
Georgi Tunev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Kenneth Mazur
Top achievements
Rank 1
answered on 23 Oct 2009, 03:08 PM
The code is indeed, in the RadWindow page.  I've tweaked the code a little as you suggested, and it now errors out saying "Object doesn't support this property or method".
                GetRadWindow().BrowserWindow.addTab("Testing");

I have the function on the parent page as follows:
   <script>
       function addtab(passedvalue)
          {
             var tabStrip = $find("<%# OpenItems.ClientID %>");
             var tab = Telerik.Web.UI.RadTab();
             tabStrip.get_tabs().add(tab);
             tab.set_text(passedvalue);
             tab.select();
          }
   </script>

I've also tried not passing a parameter, just in case.
Thanks
Ken
0
Georgi Tunev
Telerik team
answered on 26 Oct 2009, 05:46 AM
Hello Kenneth,

Check the name of the function that you try to call from within the RadWindow and the actual name of the function on your parent page.



Best wishes,
Georgi Tunev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Accepted
Poul Henningsen
Top achievements
Rank 1
answered on 26 Oct 2009, 07:25 AM
@Kenneth: hint - JavaScript is case sensitive language, so

GetRadWindow().BrowserWindow.addTab("Testing"); 
 
should be: 
 
GetRadWindow().BrowserWindow.addtab("Testing"); 

Tags
Window
Asked by
Kenneth Mazur
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
Kenneth Mazur
Top achievements
Rank 1
Poul Henningsen
Top achievements
Rank 1
Share this question
or