Question

I am curious about how to put a default image to a GridLayout item by using the templates. Can anyone provide any suggestions?

Here is my template

<div class="gridLayoutItemTemplate" data-win-control="WinJS.Binding.Template" data-win- options="{tap: 'none'}">
    <div class="photoTemplate">
        <img class="photoTemplateImage" src="#" alt="" data-win-bind="src: imageUrl WinJS.Binding.oneTime; alt: title" />
</div>

Was it helpful?

Solution

Just add a new 'loading' image in the slution and in the template just apply new style to the image and specify background image property

Example is shown below

  <img class="photoTemplateImage" src="#" alt="" data-win-bind="src: imageUrl WinJS.Binding.oneTime; alt: title"  style="background-image: url(loadingimage.gif)" />

You can add the background image property to the class.. So you can avoid using in line styles..

Change the url depend on where you storing the image

refer this post

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top