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

Adding items to rotator from javascript

2 Answers 61 Views
Rotator
This is a migrated thread and some comments may be shown as answers.
maha
Top achievements
Rank 1
maha asked on 21 Jun 2010, 01:55 PM
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" > 
                                                        <ItemTemplate> 
                                                          <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='http://www.neelwafurat.com/locate.aspx?mode=1&search=author1&entry=<%# XPath("author") %>' style='font-size: 8pt; color: white;'><%#XPath("author")%> </a></font>   
                                                                             </td></tr>  
                                                                        </table> 
                                                       
                                                                   
                                                                
                                                        </div> 
                                                        </ItemTemplate> 
                                                    </telerik:RadRotator> 
                                                    <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 Answers, 1 is accepted

Sort by
0
Fiko
Telerik team
answered on 24 Jun 2010, 07:35 AM
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,
Fiko
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
maha
Top achievements
Rank 1
answered on 28 Jun 2010, 06:49 AM
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.
Tags
Rotator
Asked by
maha
Top achievements
Rank 1
Answers by
Fiko
Telerik team
maha
Top achievements
Rank 1
Share this question
or