title: How to get index of selected item from RadAutoCompleteTextView?
body: <p>So I have installed the autocomplete plugin:</p>
  
  <pre><code>tns plugin add nativescript-ui-autocomplete
  </code></pre>
  
  <p>And added the view in my XML:</p>
  
  <pre><code>&lt;Page xmlns="http://schemas.nativescript.org/tns.xsd" 
  xmlns:au="nativescript-ui-autocomplete" loaded="pageLoaded" class="page"&gt;
  &lt;StackLayout class="p-20"&gt;
      &lt;au:RadAutoCompleteTextView id="autoComplete" items="{{ items }}" suggestMode="Suggest" displayMode="Token"&gt;
          &lt;au:RadAutoCompleteTextView.suggestionView&gt;
              &lt;au:SuggestionView suggestionViewHeight="300"&gt;
                  &lt;au:SuggestionView.suggestionItemTemplate&gt;
                      &lt;StackLayout tap="{{tokenSelected}}"&gt;
                          &lt;Label text="{{ text }}" /&gt;
                      &lt;/StackLayout&gt;
                  &lt;/au:SuggestionView.suggestionItemTemplate&gt;
              &lt;/au:SuggestionView&gt;
          &lt;/au:RadAutoCompleteTextView.suggestionView&gt;
      &lt;/au:RadAutoCompleteTextView&gt;
  &lt;/StackLayout&gt;
  </code></pre>
  
  <p></p>
  
  <p>I also added a function to the tap event of the suggestion's stacklayout and added items to the RadAutoCompleteTextView:</p>
  
  <pre><code>var Observable = require("data/observable").Observable;
  var ObservableArray = require("data/observable-array").ObservableArray;
  var autocompleteModule = require("nativescript-ui-autocomplete");
  
  var page;
  var pageData = new Observable();
  var items = new ObservableArray([]);
  
  exports.pageLoaded = function (args) {
      page = args.object;
      page.bindingContext = pageData;
  
      const persons = ["Sjoerd Pottuit", "Sjoerd Pottuit", "David Lamp", "Ryan Tulp"];
  
      for (var i = 0; i &lt; persons.length; i++) {
          items.push(new autocompleteModule.TokenModel(persons[i]));
      };
  
      pageData.set("items", items);
      pageData.set("tokenSelected", tokenSelected);
  };
  
  function tokenSelected(args) {
      //how to know which Sjoerd Pottuit is selected?
      const person = args.view.bindingContext.text;
      console.dir(args);
      console.log(person); // returns: JS: Sjoerd Pottuit
  };
  </code></pre>
  
  <p>The problem is the tokenSelected function doesn't return the index of the selected item and the RadAutoCompleteTextView only accepts objects of type TokenModel which can only contain the text and image to display as search result. </p>
  
  <p>I want the index so I can get more data from the selected person from another array.</p>
  
  <p>console.dir(args); returned:</p>
  
  <pre><code>JS: ==== object dump start ====
  
  JS: type: "1"
  JS: view: StackLayout(10)@file:///app/main-page.xml:8:25;
  JS: android: MotionEvent { action=ACTION_UP, actionButton=0, id[0]=0, x[0]=230.0, y[0]=44.0, toolType[0]=TOOL_TYPE_FINGER, buttonState=0, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=0, eventTime=617931691, downTime=617931598, deviceId=3, source=0x1002 }
  JS: ios: "undefined"
  JS: object: StackLayout(10)@file:///app/main-page.xml:8:25;
  JS: eventName: "tap"
  
  JS: ==== object dump end ====
  </code></pre>