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

Couple Things

2 Answers 99 Views
ImageGallery
This is a migrated thread and some comments may be shown as answers.
SDI
Top achievements
Rank 1
SDI asked on 26 Jun 2014, 07:52 PM
Hi Telerik,

I find limited resources on the Gallery, as far as the client object is concerned and trying to get information out of it. In otherwords, finding the text, description, etc of the currently selected image. I cant seem to get this information from the argument in the OnNavigated function. If you have documentation on it please lead me to it.

Ok, I want the OnNavigated to update other controls on the screen once that image is selected. I have textboxes and a check box that should update after the image is chosen to view. The server event - Image requested  gets hit only the first time around. So i need this event to update other controls on the screen.

<telerik:RadImageGallery ID="ImageGallery1" DataKeyNames="MemberImageId, IsPrimary, Name, Description" runat="server" Height="400px" LoopItems="true" Skin="Web20">
    <ThumbnailsAreaSettings ThumbnailsSpacing="5px" />
    <ClientSettings>
        <ClientEvents OnNavigated="OnNavigated" />
    </ClientSettings>
    <ImageAreaSettings ShowDescriptionBox="false" />                   
</telerik:RadImageGallery>

JS function
function OnNavigated(sender, args) {
    $find('<%=RadTextBoxMemberImageId.ClientID%>').set_value('1');
    $find('<%=RadTextBoxDescription.ClientID%>').set_value('Try Desc');
    $find('<%=RadButtonPrimary.ClientID%>').set_checked(false);
    $find('<%=RadTextBoxName.ClientID%>').set_value('Try Name');
}

I obviously want the 4 objects to be updated when the next/previous/other image is selected. Not the hard coded values you see. Maybe the key names have values in the js side? Like other controls, but client datakey is used. I dont see any help on the matter.

Can you guys/girls lead me in the right direction?

Thanks a bunch!







2 Answers, 1 is accepted

Sort by
0
SDI
Top achievements
Rank 1
answered on 30 Jun 2014, 09:23 PM
Okay i found the code for getting the title and the description

I do have a problem and that is getting other fields in the query to pull back the images. The primary key id , a boolean field, plus a sort order. This the ImageGalleryItem doest seem to support attributes like the rest of your controls. Can you please tell me how i can attach other values to the ImageGalleryItem? Maybe in the ItemCreated event or something on the server side. Its doesnt look like you have the ClientDataKey etither. 

Thanks
0
Angel Petrov
Telerik team
answered on 01 Jul 2014, 02:55 PM
Hello Brian,

I am sorry to say but with the current implementation there is no out of the box way to pass additional parameters to the client-side. In order to achieve the desired goal you can use the obtained  title and description and fire an AJAX request or callback that would return the additional data. An example of this approach is available in the attached website.

Please note that I have logged a feature request regarding the ClientDataKeyNames functionality and you can vote for it from here. The more votes the feedback item receives the higher the chance of implementing the feature for the next release.

Regards,
Angel Petrov
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.

 
Tags
ImageGallery
Asked by
SDI
Top achievements
Rank 1
Answers by
SDI
Top achievements
Rank 1
Angel Petrov
Telerik team
Share this question
or