title: How to get Selected item id with bootstrap typeahead
body: <p>I am receiving the following JSON from back end.</p>
  
  <pre><code>[{"video_name":"video1","video_id":"74"},{"video_name":"videoactual","video_id":"89"}]
  </code></pre>
  
  <p>I am using bootstrap type ahead for autocomplete purpose </p>
  
  <p>This is my code </p>
  
  <p>Currently on selection i am able to get the video name </p>
  
  <p>How can i get the selected video id  ??</p>
  
  <pre><code>var videoNames = new Array();
  var videoIds = new Object();
  $('#linkvideoname').typeahead({
  
  
   updater: function(selection){
          alert("You selected: " + selection)
      },
  
      source: function(query, process) {
       $.ajax({
          url: url + '/videodetails',
              dataType: "json",
                data: query,
                 contentType: "application/json; charset=utf-8",
              type: "POST",
             success: function(data) {
                   $.each( data, function ( index, video )
              {
                  videoNames.push( video.video_name );
                  videoIds[video.name] = video.video_id;
              } );
                    process(videoNames);
  
              }
          });
      },
  });
  </code></pre>