_onItemsChanged(items) {

      //Let's replace the old list in memory
      this.setState(
         { selectedItems: items }
      )

      //If the user has set a listener, let's send the list of selected indexes
      //This is a 1-based list of indexes. 
      if (this.props.onChange) {
         //Let's create a list of selected indexes
         var indexList = [];
         var i;

         for (i = 0; i < items.length; i++) {
            let index = this.getPersonaIndex(items[i].text);
            if (index > -1)
               indexList.push(index + 1);
         }

         //Sort numerically
         indexList.sort(function (a, b) {
            return a - b;
         });

         this.props.onChange(indexList.toString());
      }
   }
/**
    * Handle the new list of selected items. 
    * Microsoft sends in the full list of selected items every time, rather than just a delta. So let's save them.
    * @param {Array} items The full list of selected items.
    */
Handle the new list of selected items.
Microsoft sends in the full list of selected items every time, rather than just a delta. So let's save them.
@param {Array} items The full list of selected items.
Handle the new list of selected items . Microsoft sends in the full list of selected items every time rather than just a delta . So let ' s save them . @param { Array } items The full list of selected items .
_onItemsChanged(items) {
      this.setState(
         { selectedItems: items }
      )
      if (this.props.onChange) {
         var indexList = [];
         var i;
         for (i = 0; i < items.length; i++) {
            let index = this.getPersonaIndex(items[i].text);
            if (index > -1)
               indexList.push(index + 1);
         }
         indexList.sort(function (a, b) {
            return a - b;
         });
         this.props.onChange(indexList.toString());
      }
   }
_onItemsChanged ( items ) { this . setState ( { selectedItems : items } ) if ( this . props . onChange ) { var indexList = [ ] ; var i ; for ( i = 0 ; i < items . length ; i ++ ) { let index = this . getPersonaIndex ( items [ i ] . text ) ; if ( index > - 1 ) indexList . push ( index + 1 ) ; } indexList . sort ( function ( a , b ) { return a - b ; } ) ; this . props . onChange ( indexList . toString ( ) ) ; } }
Handle the new list of selected items.
Handle the new list of selected items .
//Let's replace the old list in memory //If the user has set a listener, let's send the list of selected indexes //This is a 1-based list of indexes.  //Let's create a list of selected indexes //Sort numerically