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?
10 Answers, 1 is accepted
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
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.
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.
Svetlina
the Telerik team
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
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..
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.
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
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.
Thanks for you reply and the creation of the feature request.