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

How to set pageview to a tab using client method

3 Answers 76 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
Big Q
Top achievements
Rank 1
Big Q asked on 09 Aug 2010, 03:18 PM
Hello team,

    How to set pageview to a tab using client method? 
    I added a tab and a pageview with client method, but when I click this new tab, the new pageview can not be shown.I think it's because of that I didn't set the pageview to tab, but I don't know how to achieve it with client side method, it seems server side has a method ,but client side not.

Below is the function which I use:

             var tabStrip =  $find("<%= RadTabStrip1.ClientID %>");
             var tab = new Telerik.Web.UI.RadTab();
             tab.set_text("New Tab");
             tabStrip.trackChanges();
             tabStrip.get_tabs().add(tab);             
             tabStrip.commitChanges();
             
             var multiPage = $find("<%=RadMultiPage1.ClientID %>");            
             multiPage.trackChanges();
             var pageView = new Telerik.Web.UI.RadPageView();

             multiPage.get_pageViews().add(pageView);
             pageView.get_element().innerHTML = "<iframe src='http://www.google.com' width='100%' height='600px'>";
             multiPage.commitChanges();

thanks

3 Answers, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 09 Aug 2010, 04:00 PM
Hello,

You should use set_pageViewID(id) method of the client object of RadTab to set the pageview. Also note that the used iframe is not closed properly and this also may cause some problems, please modify it like this:

pageView.get_element().innerHTML = "<iframe src='http://www.google.com' width='100%' height='600px'></iframe>";

Kind regards,
Yana
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Big Q
Top achievements
Rank 1
answered on 09 Aug 2010, 06:03 PM
Hi,

    I have changed my function like this:

             var multiPage = $find("<%=RadMultiPage1.ClientID %>");
             multiPage.trackChanges();
             var pageView = new Telerik.Web.UI.RadPageView();            
             multiPage.get_pageViews().add(pageView);
             pageView.get_element().innerHTML = "<iframe src='http://www.google.com' width='100%' height='600px'></iframe>";             
             multiPage.commitChanges();

             var tabStrip =  $find("<%= RadTabStrip1.ClientID %>");
             var tab = new Telerik.Web.UI.RadTab();
             tab.set_text("New Tab");
             tab.set_pageViewID(pageView.get_id());
             alert(pageView.get_id());
             tabStrip.trackChanges();
             tabStrip.get_tabs().add(tab);
             tabStrip.commitChanges();
             tabStrip.repaint();   

But it still doesn't work, pageView.get_id() is undefined.Should I have to add an "ID" to the pageView when it was created? how to?

0
Yana
Telerik team
answered on 10 Aug 2010, 02:14 PM
Hello,

I'm sorry for not explaining that.

Yes, you should set id to the pageview using set_id() client-side method.

Kind regards,
Yana
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
TabStrip
Asked by
Big Q
Top achievements
Rank 1
Answers by
Yana
Telerik team
Big Q
Top achievements
Rank 1
Share this question
or