Hello,
I think I may have found a problem (although it might not be an "exposed" problem) with the RadRotator in the most current release...
I am setting attribute values of the rotator item from the database on ItemDataBound...
then when the item is shown on the client, I update various GUI elements to what they should be based on the attributes.
getting the item attributes of the radrotator was a bit difficult, and someone at telerik helped me by providing me with the GetAttributeValue function (shown in the javascript code below).
Perhaps some of this has changed???
The page was working fine, and then when I updated to the new release it started behaving a bit differently...
if i move onto the nth item from the (n-1)th item, the GUI updates to the correct values for the (n-1)th item...
on the other hand, if i move onto the nth item from the (n+1)th item, the GUI updates to the correct values for the (n+1)th item...
any ideas?
edit:
it seems that the RotatorClientItemClicked event is also a bit faulty...
when clicking an item, the rotator moves to the correct item, however it does NOT do so with animation...
in addition, the GUI does not change at all when this happens...
I think I may have found a problem (although it might not be an "exposed" problem) with the RadRotator in the most current release...
I am setting attribute values of the rotator item from the database on ItemDataBound...
then when the item is shown on the client, I update various GUI elements to what they should be based on the attributes.
getting the item attributes of the radrotator was a bit difficult, and someone at telerik helped me by providing me with the GetAttributeValue function (shown in the javascript code below).
Perhaps some of this has changed???
The page was working fine, and then when I updated to the new release it started behaving a bit differently...
if i move onto the nth item from the (n-1)th item, the GUI updates to the correct values for the (n-1)th item...
on the other hand, if i move onto the nth item from the (n+1)th item, the GUI updates to the correct values for the (n+1)th item...
any ideas?
void
_rotator_ItemDataBound(
object
sender, RadRotatorEventArgs e)
{
DataRowView itemView = e.Item.DataItem
as
DataRowView;
if
(itemView !=
null
)
{
e.Item.Attributes[
"imageUrl"
] = ImagesFolderUrl + itemView.Row[
"DocumentID"
].ToString().PadLeft(8,
'0'
) +
"/"
+ itemView.Row[
"PageNumber"
].ToString().PadLeft(4,
'0'
);
e.Item.Attributes[
"Author"
] = isnullorempty(itemView.Row[
"Author"
].ToString(),
" "
);
e.Item.Attributes[
"AuthorTitle"
] = isnullorempty(itemView.Row[
"AuthorTitle"
].ToString(),
" "
);
e.Item.Attributes[
"CompanyName"
] = isnullorempty(itemView.Row[
"CompanyName"
].ToString(),
" "
);
e.Item.Attributes[
"PageNumber"
] = itemView.Row[
"PageNumber"
].ToString();
e.Item.Attributes[
"TitleDescription"
] = isnullorempty(itemView.Row[
"TitleDescription"
].ToString(),
" "
);
e.Item.Attributes[
"ConferenceName"
] = isnullorempty(itemView.Row[
"Conference"
].ToString(),
" "
);
e.Item.Attributes[
"PresentationDate"
] = ((DateTime)itemView.Row[
"DateOfPresentation"
]).ToString(
"MMMM dd, yyyy"
);
e.Item.Attributes[
"SlideID"
] = itemView.Row[
"SlideID"
].ToString();
e.Item.Attributes[
"DocumentID"
] = itemView.Row[
"DocumentID"
].ToString();
e.Item.Attributes[
"PageLayout"
] = itemView.Row[
"PageLayout"
].ToString();
if
(itemView.Row.Table.Columns.Contains(
"resultID"
))
e.Item.Attributes[
"resultID"
] = itemView.Row[
"resultID"
].ToString();
}
}
function
SetRotatorToSlideID(slideID) {
var
items = rotator.get_items();
for
(i
in
items) {
if
(slideID == GetAttributeValue(items[i],
"SlideID"
)) {
rotator.set_currentItemIndex(items[i].get_index(),
true
);
UpdateGUI(items[i]);
break
;
}
}
}
function
GetAttributeValue(anObject, strProperty) {
if
(anObject) {
var
attributes = $telerik.$(
'['
+ strProperty +
']:first'
, anObject.get_element()).attr(strProperty);
if
(attributes) {
return
attributes;
}
}
}
function
RotatorClientItemShowing(sender, args) {
stateHandled =
true
;
setLoading(
true
);
UpdateGUI(args.get_item());
}
function
RotatorClientItemShown(sender, args) {
stateHandled =
false
;
}
function
RotatorClientItemClicked(sender, args) {
sender.set_currentItemIndex(args.get_item().get_index(),
true
);
}
function
UpdateGUI(item) {
var
companyName = GetAttributeValue(item,
"CompanyName"
);
var
title = GetAttributeValue(item,
"TitleDescription"
);
var
pageNum = GetAttributeValue(item,
"PageNumber"
);
var
author = GetAttributeValue(item,
"Author"
);
var
authorTitle = GetAttributeValue(item,
"AuthorTitle"
);
var
conference = GetAttributeValue(item,
"ConferenceName"
);
var
presDate = GetAttributeValue(item,
"PresentationDate"
);
var
layout = GetAttributeValue(item,
"PageLayout"
);
document.getElementById(
"lblSelectedRotatorItem"
).innerText = companyName +
" - "
+ title +
" - "
+ author +
" - Page "
+ pageNum;
document.getElementById(
"LargeImage"
).src = GetAttributeValue(item,
"imageUrl"
) +
".png"
;
document.getElementById(
"LargeImage"
).width = ImageWidth(layout);
document.getElementById(
"lblCompanyName"
).innerText = companyName;
document.getElementById(
"lblTitle"
).innerText = title;
document.getElementById(
"lblConferenceName"
).innerText = conference;
document.getElementById(
"lblAuthor"
).innerText = author;
document.getElementById(
"lblAuthorTitle"
).innerText = authorTitle;
document.getElementById(
"lblDate"
).innerText = presDate;
setHash(GetAttributeValue(item,
"DocumentID"
), GetAttributeValue(item,
"SlideID"
));
setLoading(
false
);
}
edit:
it seems that the RotatorClientItemClicked event is also a bit faulty...
when clicking an item, the rotator moves to the correct item, however it does NOT do so with animation...
in addition, the GUI does not change at all when this happens...