I have JSON data returned in my action controller:
$results = $repo->getMatchingCityName($searchTerm);
Response that i'm getting:
[{"CityName":"Montreal"},{"CityName":"New york"}]........
But jquery ui autocomplete doesn't show anything
tried
$this->_helper->json(array_values($results));
and
Zend_Json::encode($results);
But no use. How do I convert into
[{"value":"Montreal","label":"Montreal"},{"value":"New york","label":"New york"}]
I got it working like this
Added the view helper in bootstrap