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

ImageGallery Item Accessing ImageURL

1 Answer 123 Views
ImageGallery
This is a migrated thread and some comments may be shown as answers.
Min
Top achievements
Rank 1
Min asked on 29 Sep 2014, 03:12 PM
Hello, 
I am trying to preload the full images retrieved from a database and bound to the ImageGallery control to cache the images in the browswer and help improve our user experience using javascript. 

I have tried access the image url by getting the RadImageGalleryItems collection and then call get_imageUrl for each item in the array on the OnImageGalleryCreated client-side event.  I can see that there is a ThumbnailUrl associated with each item when I debug in the browser but the ImageUrl is empty.  However, when I click on a Thumbnail image it makes a call to retrieve the full image with a unique imgid which is different than the imgid used for the smaller Thumbnail image. 

Is there a different way to access the full image Url for each Thumbnail?  I've read all the documentation related to the RadImageGallery client-side objects but still can't figure out how to make this work correctly.

thanks,
Min

1 Answer, 1 is accepted

Sort by
0
Antonio Stoilkov
Telerik team
answered on 02 Oct 2014, 10:10 AM
Hello,

You are correct in your observations. When RadImageGallery is bound to a folder or a data source containing binary data the images are dynamically created and there is no way to know the big image URL before creating it. This is because the items are created on demand only when required in order to optimize performance.

However, if you want to access the big image URL the approach you could implement is to create a static collection of RadImageGallery items and set its ImageUrl property on the first page load. This could be achieved by manually converting the bytes into files and then providing the URL's to the new files.

Regards,
Antonio Stoilkov
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
Min
Top achievements
Rank 1
Answers by
Antonio Stoilkov
Telerik team
Share this question
or