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

RadRotator set_currentItemIndex not a method

1 Answer 60 Views
Rotator
This is a migrated thread and some comments may be shown as answers.
Clifton Brown
Top achievements
Rank 1
Clifton Brown asked on 03 May 2011, 12:50 AM
Hello, I'm running version 3Q 2009 of the ASP.NET AJAX controls. I wanted to implement the Rotator with index buttons as in this tutorial

http://demos.telerik.com/aspnet-ajax/rotator/examples/pagerintegration/defaultcs.aspx

however, I'm getting a javascript error Object does not support method or property when the JS function tries to excute the line
oRotator.set_currentItemIndex(index);

I did a "Quick Watch" using the visual studio debugger and noticed that that this function is missing from the available functions. Is this feature not available in 3Q 2009 version? if not is there a workaround to display buttons to represent each slide and then have those buttons clicked to display the corresponding slide in the rotator?

function showItemByIndex(index)
{
    // get reference to the rotator object
    var oRotator = $find("<%= RadRotator1.ClientID %>");
 
    // Set currently shown item by its index
    oRotator.set_currentItemIndex(index);
}

Thanks
Cliff

1 Answer, 1 is accepted

Sort by
0
Niko
Telerik team
answered on 05 May 2011, 01:31 PM
Hello Cliff,

Indeed, the set_currentItemIndex method is not present it the 2009.Q3 version of the Telerik ASP.NET AJAX controls. I have prepared a sample implementation that could replace the setter, which however is not 100% fault proof. Here is the code snippet:
function showNext(rotator, index)
{
    var rotatorScrollDuration = rotator.get_scrollDuration();
    rotator.set_scrollDuration(0);
    rotator._nextItemIndex = index;
    rotator.showNext();
    rotator.set_scrollDuration(rotatorScrollDuration);
}

Still, your best option is to upgrade to the latest version of the controls and have the up-to-date functionality at hand.

Hope this helps.

Greetings,
Niko
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Tags
Rotator
Asked by
Clifton Brown
Top achievements
Rank 1
Answers by
Niko
Telerik team
Share this question
or