awesomecomplete
awesomecomplete copied to clipboard
how to use dataMethod
i dont know how to use dataMethod. i setup like this: $(function() { $('#friend_id2').awesomecomplete({ //more config dataMethod: dataMethod }); }); var dataMethod = function(term, $awesomecomplete, onData) { onData = [ { name: 'Ryan Lapin', email: '[email protected]', phone: '(512) 829-4442' }, { name: 'Angela Kapoor', email: '[email protected]', phone: '(435) 149-4341' }, { name: 'Pam Martin', email: '[email protected]', phone: '(204) 189-7995' } ]; return onData; };
it didn't work for me. I want to call ajax and get data from server
Call onData instead. Replace return onData;
with onData([{ name: /* … */ }]);
.
thanks for reply, but i still dont understand what you say: onData([{ name: /* … */ }]); write for me little bit of code to show how it work. thank you so much