title: How to render JSON response using latest typeahead.js library
body: <p>I have got a search box in my application where in users can search for a patient details stored in the database. they would type in the name of the patient and server will respond back with JSON response with all the details. In order to facilitate such functionality, I am using the latest version typeahead.js.</p>
  
  <p>Here is my javascript code:</p>
  
  <pre><code>$("#search-box").typeahead({
      remote: 'searchPatient.do?q=%QUERY'
  });
  </code></pre>
  
  <p>This code gives me following JSON response:</p>
  
  <pre><code>[
   {
    "id":1,
    "surname":"Daniel",
    "forename":"JOHN",
    "address":
              {
                "id":23,
                "houseNameOrNumber":"35",
                "addressDetail":"Roman House",
                "postCode":"NE1 2JS"
              },
    "gender":"M",
    "age":27,
    "dateOfBirth":"25/08/1985"
   }
  ]
  </code></pre>
  
  <p>When typeahead library tries to render this response, I always see undefined in the drop down list. I want to show all the fields of this response in the auto suggest drop down list. I would appreciate if someone could guide me in doing so. </p>
  
  <p>I want to display record like this in the drop down list:</p>
  
  <pre><code>John Daniel (M, 27)
  35 Roman House, NE1 2JS
  25/08/1985
  </code></pre>
  
  <p>Thanks in advance!</p>