2 Replies Latest reply on Apr 13, 2009 9:16 AM by firdosh

    How to make an itemrenderer not selectable for TileList

    firdosh Level 1

      Hey everyone,

                            I have a custom renderer foe a TileList which displays a 3x3 grid. The items get be moved around to sort the list. Sometimes the collection may have only 7 items so I need to to create 2 more additional renderers which represent the empty state of the itemrenderer. What I am trying to achieve is that when the user clicks the empty items the previous or current selected item does not loose focus, so in othe words I need to make the empty items not selectable so that the user can also not drag these items around.

       

      ---------------

      | X | X | X |

      ---------------

      | X | X | X |

      ---------------

      | X | O | O|

       

      Currently the way I detect if the item is selected or not by

       

      override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
      {
         if(ListBase(owner).isItemSelected(data))
         {
            
           //Show selected state
         }
         else
         {
           //Hide
         }
      }
      

       

      Thanks,

      Firdosh