1 Reply Latest reply on Aug 10, 2011 6:13 AM by Amy Blankenship

    what is the point of [Bindable("selectionChange")] in parts of the spark datagrid class?

    nikos101 Level 2

      I dont understand the point of this code in the spark datagrid class:

       

      what is the point of this:

       

          [Bindable("selectionChange")]
           [Bindable("valueCommit")]
           [Inspectable(category="General", defaultValue="null")]

       

       

       

      in

       

       

       

       

      //----------------------------------
          //  selectedItem
          //----------------------------------
         
          [Bindable("selectionChange")]
          [Bindable("valueCommit")]
          [Inspectable(category="General", defaultValue="null")]
         
          /**
           *  @copy spark.components.Grid#selectedItem
           *
           *  @default null
           * 
           *  @langversion 3.0
           *  @playerversion Flash 10
           *  @playerversion AIR 2.5
           *  @productversion Flex 4.5
           */
          public function get selectedItem():Object
          {
              if (grid)
                  return grid.selectedItem;
             
              return (dataProvider && (selectedIndex > 0)) ?
                  dataProvider.getItemAt(selectedIndex) : undefined;
          }
         
          /**
           *  @private
           */
          public function set selectedItem(value:Object):void
          {
              if (grid)
                  grid.selectedItem = value;
              else
              {
                  var f:Function = function(g:Grid):void
                  {
                      g.selectedItem = value;
                  }
                  deferredGridOperations.push(f);
              }
          }