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

CoverFlowButtons buttons not enabling properly

1 Answer 31 Views
Rotator
This is a migrated thread and some comments may be shown as answers.
PaulH
Top achievements
Rank 1
PaulH asked on 06 Mar 2013, 03:41 PM
Hi there.

I'm using a Rotator set in CoverFlowButtons mode and on the whole it works fine. However, I have a situation whereby the current index of the rotator gets changed by some javascript code based on an external condition. When the index changes from the first item to any other item in the collection the previous button doesn't get enabled. If my code changes the index to the last item in the list I also find that the next button doesn't get disabled. However, if I interact directly with the rotator by clicking on one of the items or by clicking the next button while there is a next item to go to the enabling and disabling of the buttons then happens correctly. It's just the initial entry to the form and manipulation of the rotator via the javascript prior to actually doing something manual with it where the issue manifests itself. Is there something I can or should do to ensure that the buttons disable and enable correctly or is this a fault that you can fix?

The actual code I use to change the relevant item is as follows:
if (itemIndex != -1) {
    var coverFlow = $find('<%= CoverFlow.ClientID %>');
    $(coverFlow.set_currentItemIndex(itemIndex, false));
}
The "itemIndex" is a value that is calculated initially based on certain conditions.


Thanks and regards

1 Answer, 1 is accepted

Sort by
0
Slav
Telerik team
answered on 11 Mar 2013, 12:12 PM
Hello Paul,

Truly, the enabled/disabled state of the RadRotator's control buttons is not applied correctly when the function set_currentItemIndex(index) is used before the items of the CoverFlow rotator are scrolled. This issue will be brought to the attention of our developers, nevertheless I cannot provide a firm estimate when a fix will be available. You can track the status of the bug, comment it and vote for it via the feedback item that I logged.

For the time being you can workaround the problem by programmatically initiating a scroll via the showNext client-side method of RadRotator as shown below:
<script type="text/javascript">
    // OnClientLoad event handler
    function RotatorLoad(sender, args) {
        var rotatorDirection = Telerik.Web.UI.RotatorScrollDirection;
        sender.showNext(rotatorDirection.Left);
        sender.showNext(rotatorDirection.Right);
 
        sender.set_currentItemIndex(3, false);
    }
</script>

I have updated your Telerik points accordingly as a token of gratitude of reporting the problem.

All the best,
Slav
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Rotator
Asked by
PaulH
Top achievements
Rank 1
Answers by
Slav
Telerik team
Share this question
or