如何在twitter上设置onClick选项typeahead.jssearch查询结果?

我是新来的typeahead.js。 我写了一个示例代码来使用typeahead从数据库检索结果。 后端服务器正在Node.js上运行。

这是打头的代码:

$(document).ready(function() { $('input.typeahead').typeahead({ name: 'customers', remote: 'http://localhost:3000/searchCustomers?key=%QUERY', limit: 10 }); }); 

这里是Node.js API:

 exports.searchCustomers = function(req, res) { con.connection.query('SELECT * FROM customers WHERE fname LIKE "%' + req.query.key + '%"', function(err, rows, fields) { if (err) { console.log(err); } var fullName = []; for (var i = 0; i < rows.length; i++) { fullName.push(rows[i].fname + " " + rows[i].lname); } res.send(JSON.stringify(fullName)); }) } 

当我尝试查找客户名称时,显示查询的结果。

现在,我需要能够创buildsearch结果的onclick,以便我可以得到客户信息。 我已经尝试了几种方法,但是,我还没有做到。 我怎样才能达到相同的?