Adding items to rotator from javascript

3 posts, 0 answers
  1. maha
    maha avatar
    44 posts
    Member since:
    Jun 2010

    Posted 21 Jun 2010 Link to this post

    I have the following rotator
    <telerik:RadRotator ID="RadRotator1b" runat="server"  Height="190px" width="880px" BackColor="#a6ce39"    
                                                                  RotatorType="ButtonsOver" ItemHeight="100px" ItemWidth="165px"  Skin=""   cssclass="RadRotator_rotatorSkin"  ScrollDuration="350"  FrameDuration="800" > 
                                                              <div class="itemTemplate">  
                                                                 <table style='margin:1px 1px 1px 1px;background-color:transparent;padding:0;border:none;cursor:pointer;width:100%;-moz-border-radius:1px;-webkit-border-radius:1px;' > 
                                                                                <tr><td  style="width:10%">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td><td  style="width:80%"><href='<%# XPath("link") %>' target="_blank" style="width:100%">  
                                                                                     <img src='<%# XPath("src") %>'  border='0' hspace='0' width='90' height='130' align='center'/>  </a></td>  
                                                                                  <td  style="width:10%">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td></tr>  
                                                                              <tr><td style="width:100%" colspan='3' align="center">    
                                                                                  <href='<%# XPath("link") %>' style='font-weight: bold; font-size: 8pt; color: #484849;'><%# XPath("title") %> </a></font</td></tr>  
                                                                               <tr><td style="width:100%; color:White; " colspan='3' align="center">    
                                                                              <%#XPath("t")%>&nbsp;</asp:Label><a href='<%# XPath("author") %>' style='font-size: 8pt; color: white;'><%#XPath("author")%> </a></font>   
                                                        <asp:XmlDataSource ID="XmlDataSourceb1" runat="server" XPath="books/book"  DataFile="~/generated_files/bitems.xml" ></asp:XmlDataSource> 

    I am not setting the datasourceid to be XmlDatasourceb1 because i want to set it from javascript function.I need the items to load on tabclick event.This rotator is inside a pageview of a tab.How can i do that?Is it possible to set datasourceid from javascript?
  2. Fiko
    Fiko avatar
    1406 posts

    Posted 24 Jun 2010 Link to this post

    Hi Maha,

    DataSourceID property of ASP.NET controls is a server-side property and it cannot be set by JavaScript on the client. For the time being RadRotator control does not provide client-side API that can be used in order to add items client-side, but we will do our best to implement such feature for the future releases of the control. We have made the first step by adding lazy loading for the Rotator's items. This new feature will be officially available in the upcoming Q2 2010 release of the control, but you can test it in the recent Q2 2010 BETA release.

    Kind regards,
    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
  3. maha
    maha avatar
    44 posts
    Member since:
    Jun 2010

    Posted 28 Jun 2010 Link to this post

    i was able to do that by using RadXmlHttpPanel and putting the rotator inside it.By doing that i was able to load items into rotator without reloading the page.
Back to Top