title: Flex spark list vistual layout control how many items are binded
body: <p>I have a spark list with custom Itemrenderer.
  I use virtuallayout , because I'm binding it with about 500 elements.</p>
  
  <p>I traced the datachange event of the item renderer and I've seen that about 120 items are binded to the list on the first load.
  I need to show only 10 items on the stage, so I want to decrease the number of items fetched in the list, is there a property or a function to override to obtain this behaviour?</p>
  
  <p>The code is so simple</p>
  
  <pre><code>&lt;s:List  id="thumbnailList" verticalScrollPolicy="off" 
  
   useVirtualLayout="true" itemRenderer="ThumbnailItemRenderer" &gt;
          &lt;s:layout&gt;
              &lt;s:HorizontalLayout gap="10"  requestedColumnCount="10"  /&gt;
          &lt;/s:layout&gt;
      &lt;/s:List&gt;
  </code></pre>
  
  <p>The item renderer</p>
  
  <pre><code>&lt;s:ItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009" 
                      xmlns:s="library://ns.adobe.com/flex/spark"
                      autoDrawBackground="false"  &gt;
      &lt;fx:Script&gt;
  
  
  
              override public function set data(value:Object):void{
                  super.data=value;
                  if(data !=null){
                      LoadImg();
  
                  }
              }
  
  
              protected function LoadImg():void{
                  trace(data.pagnum.toString());
                  var cacheDir:File=null;
                  cacheDir= Config.DirCache();
                  var folder:File = new File(cacheDir.nativePath + Config.CATALOG_FOLDER_NAME + Config.selected_catalog_id + "/");                    
                  var file:File = new File(folder.nativePath + "/" + data.pagnum.toString() + "_th.jpg"); 
                  trace(file.url);
                  thumbnail.source = file.url;
  
                  cacheDir=null;
                  folder=null;
                  file=null;
  
              }
  
  
  
      &lt;/fx:Script&gt;
  
  
      &lt;s:Image id="thumbnail" top="0" left="0" right="0" bottom="0" scaleMode="letterbox" cacheAsBitmap="true"  /&gt;
  &lt;/s:ItemRenderer&gt;
  </code></pre>
  
  <p>and the binding of the list</p>
  
  <pre><code>thumbnailList.dataProvider= {ArrayCollection with about 480 items}
  </code></pre>