Load On Demand, WebService Parameters

12 posts, 0 answers
  1. Joe
    Joe avatar
    11 posts
    Member since:
    Sep 2007

    Posted 06 Aug 2010 Link to this post

    In the load on demand example, you are calling a web service with a method GetRotatorData.  the signature of GetRotatorData requires a parameter called itemindex.  I cannot see where you are setting this in the rotator defintiion or the javascript of the page.  

    Can someone point me in the right direction.  We have a web service which requires us to pass in a date of the last post displayed on the page, we'd like RadRotator to get the data from the web service and then when it needs more data (load on demand) it send the max date back to the web service.

    Can you provide any guidance?
  2. Svetlina Anati
    Admin
    Svetlina Anati avatar
    2795 posts

    Posted 11 Aug 2010 Link to this post

    Hi Joe,

    The itemindex should not be set by you manually - it is needed to determine the already loaded items count for scenarios that e.g you want to show maximum number of items or manipulate them based on the reached count. In your case you have full control over what will be rendered back in the rotator - you should return the desired count of items and put teh desired HTML. The rotator itself will automatically request the new portion of items when the need for LOD occurs. As to saving values e.g dates, it is not needed to pass them to the rotator - you should organize your logic by using common ASP.NET code, store, extract or calculate values as you require. The rotator needs only array of items which is returned and it will automatically make teh next call. Also, teh parameter in mention provides more control but it is not required for all scenarios and you are not obliged to use it in case your scenario does not need - in fact this is an additional parameter which  provides information about the items count but it is not an optional parameter to pass along to rotator and WebService.

    Kind regards,
    Svetlina
    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. UI for ASP.NET Ajax is Ready for VS 2017
  4. Joe
    Joe avatar
    11 posts
    Member since:
    Sep 2007

    Posted 11 Aug 2010 Link to this post

    Svetlana - so between this and our support ticket we have a plan of attack on how to get the data from a web service - but now we are looking for an example of using the addRotatorItem javascript method with a multi-column object and having it bind

    so we are getting back an id, description and image URL - we want to show the image, the description next to it and then use the url to put a hyperlink on the picture using the addRotatorItem and the ItemTemplate collection of the Rotator?

    At this point we can't see how to add the items without us manually creating the text/html code.
  5. Svetlina Anati
    Admin
    Svetlina Anati avatar
    2795 posts

    Posted 16 Aug 2010 Link to this post

    Hi Joe,

     Indeed, you are correct that currently the load on demand functionality and the addRotatorItem client method as well does support only setting HTML to items and you cannot directly use a template. However, you can form the same HTML which should be rendered since you have the information and the built-in template is also rendered with HTML. That is why what I can suggest is to see what the template should render and e.g form a string of HTML template - after that all you should do is to replace the particular elements of this string with the actual information and to return this as HTML for the item.

    On a side note, providing the ability to work directly with Load On Demand and templates is in our TODO list. However, I cannot tell you when exactly this will be implemented since this feature needs a strong research of possible implementations, scenarios, approaches, etc and it will be also time taking (so as testing it) and there are already tasks with a higher priority set while providing the HTML could lead to the same end result with some extra code from the developer. This being said, I can confirm that what you ask for will be implemented but I cannot give you an exact time estimate.

    Sincerely yours,
    Svetlina
    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
  6. Joe
    Joe avatar
    11 posts
    Member since:
    Sep 2007

    Posted 16 Aug 2010 Link to this post

    Do you have any examples of using the addRotatorItem in javascript?    we have been trying numerous things but have been unable to get anything to appear, even though it does seem to us that our javascript is executing.

  7. Svetlina Anati
    Admin
    Svetlina Anati avatar
    2795 posts

    Posted 19 Aug 2010 Link to this post

    Hi Joe,

     In order to add a rotator item on the client you should create the object which represents it and assign the Html property as shown below:

    Example:
    var radRotatorItemData = {};
      
    radRotatorItemData.Html = <div>Item's content</div>
      
    addRotatorItem(radRotatorItemData, 0); // Adds a new item at the beginning of the rotator's item collection.

    where the second argument is the index where the item should be added.

    This is documented in teh client API of the control below:

    http://www.telerik.com/help/aspnet-ajax/rotator-clientside-api.html

    Sincerely yours,
    Svetlina
    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
  8. vijay
    vijay avatar
    1 posts
    Member since:
    Nov 2014

    Posted 07 Nov 2014 in reply to Svetlina Anati Link to this post

    Hi Svetlina,

    I was trying to implement radrotator with loadondemand functionality.
    I took the code from
    http://demos.telerik.com/aspnet-ajax/rotator/examples/loadondemand/defaultcs.aspx
    But when i pasted the same code. I am getting many errors including 'QuickStart' namespace cant be found.
    Even I am getting how they have added web services and all in the project.
    Please give me the working application code for this scenario.

    Thanks alot in advance..
  9. Slav
    Admin
    Slav avatar
    1355 posts

    Posted 12 Nov 2014 Link to this post

    Hello,

    Most probably you copied some the of components that are declared in the project of the demos. You can use the instructions for isolating a demo that can be accessed by clicking the Demo isolation steps link in the code viewer of the demo.

    Another option is to use the example that is attached in this forum thread as a reference.

    Regards,
    Slav
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  10. arnaud
    arnaud avatar
    104 posts
    Member since:
    Jul 2008

    Posted 09 Feb 2015 in reply to Svetlina Anati Link to this post

    Hi,

    5 years later, loadondemand + templates is still not implemented. The only use of the clienttemplate is with the RadClientDataSource but it does not have any loadondemand capability. (correct me if I'm wrong)

    Right now and for complex scenario there is  no solution I'm aware of.

    Arnaud
  11. Slav
    Admin
    Slav avatar
    1355 posts

    Posted 12 Feb 2015 Link to this post

    Hello Arnaud,

    Indeed, ItemTemplate cannot be used with a load on demand RadRotator. The ClientTemlpate is used for client-side data binding of the rotator as you already noticed. This functionality is different and its template is not designed to be used with loading items on demand.

    I created a feature request item in our feedback portal so that you can track the status of this feature, vote for it and comment it: http://feedback.telerik.com/Project/108/Feedback/Details/150801. The feature will be considered for implementation if it gains a lot of votes.

    As for the difficulties you encountered, you could describe your scenario in detail so that I can suggest an alternative approach if such is possible.

    Regards,
    Slav
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  12. arnaud
    arnaud avatar
    104 posts
    Member since:
    Jul 2008

    Posted 12 Feb 2015 in reply to Slav Link to this post

    Hello Slav,

    Thanks for you reply and the creation of the feature request.
  13. arnaud
    arnaud avatar
    104 posts
    Member since:
    Jul 2008

    Posted 12 Feb 2015 in reply to Slav Link to this post

    Hello Slav,

    Thanks for you reply and the creation of the feature request.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017