3 Replies Latest reply on May 17, 2012 4:17 AM by Malacool

    Spry JSON Dataset doesnt show the image in region

    Malacool

      Dear Sir,

       

      I have the following error less code function which populate the images array and than make the Dataset from setDataFromArray(), its running ok and populate with the images and display on HTML page..

       

      Problem:

       

      i have the setInterval Function for changing the picture via setCurrentRow() at display region area from the dataset populated from array but few pictures dosnt display on the region properly,, even it reside in the ds object. Code for populating the dataset is and HTML region is below. Kindly please assist me for this problem. thanks.

       

      function datasetload(notificationType,notifier, data){

       

                               if (notificationType != "onPostLoad")

                                    return;

       

             if(maindataset.getData().length > 0){

                                      var rowdata = maindataset.getData();

                                      picarr = new Array();

       

                                 for(var i=0; i<rowdata.length; i++){

                                              if(rowdata[i].Picture.replace(/\s/g,'') != ''){

                                               picarr.push(rowdata[i]);

                                               //break;

                                              }

                                 }

                picds.setDataFromArray(picarr);

                Spry.Data.Region.addObserver("imgdivmain", ImgObserver);

                   }

                }

      ///////////////////////////////////////////////////////////////////////////////

      <div id="imgdivmain" spry:region="picds" spry:repeatchildren="picds" class="SpryHiddenRegion" >

        <div id="loading" style="position:absolute; top:50%; left:0px; right:0px; margin-left:50%; margin-right:auto" spry:state="loading"><img src="images/lightbox-ico-loading.gif" width="32" height="32" align="absmiddle" /> loading...</div>

       

        <img id="mainimage" spry:state="ready" spry:if="'{Picture}' != '' && {ds_RowCount} > 0 && {ds_CurrentRowNumber} == {ds_RowNumber}"  src='admin/uploads/large_img/{Picture}' width='100%' />

       

        <div id="headtxt" spry:if="{ds_RowCount} > 0 && {ds_CurrentRowNumber} == {ds_RowNumber}" style="font-family: 'Segoe UI', Tahoma, Verdana, Arial; font-style: italic; margin-left: auto; margin-right: auto; font-weight: bold; letter-spacing: -0.09em; background-color: #FFCC00; padding-left: 15px; padding-bottom: 2px; padding-right: 15px; padding-top: 2px; position:absolute; top:159px; color:#000000; font-size:28px;">{Name}/{ds_RowNumber}/{ds_RowCount}/{Picture}</div>

       

      </div>