Closed shivsuthanmhub closed 7 years ago
Hi @shivsuthanmhub
cool to hear that you use the component for your projects. Well you need to implement your search logic by yourself in the getTestItems(query)
method. Normally you pass the query string to a backend service and it returns the values based on that search query. In your case you need to filter through your static JSON by yourself and return the proper values according to the search query.
Hope that helps.
Thanks and regards
Guy
Hi @guylabs happy to see your quick replies. Actually, I handled the functionality using like below.
$scope.getTestItems = function (query) {
if (query) {
return {
items: $filter('filter')($scope.MYJSONDATA,query)
};
}
return {items: []};
};
After solving this issues, I'm facing one more challenge!!! Is it possible to show all my JSON value before typing the character in the search box, Because when I was opened the modal window it's empty I meant the list view is empty I want to fill all the JSON value from the initial time itself after that user wants to type search or else they can directly scroll and choose their known values.
Hi @shivsuthanmhub,
Have a look at the documentation here: https://github.com/guylabs/ion-autocomplete#the-items-method as there the isInitializing
flag is described and this is exactly for that use case. When this is true you need to return the whole list and then it is shown properly.
Hi @shivsuthanmhub
any news on this? I will close the issue due to inactiviti and you can reopen it again if there is something unclear.
Thanks and regards
Guy
Hi Team,
I used this valuable plugin for my ionic angular application and it's looking and working good. But when I was trying to load the key-value pair json it's not worked properly. Please find the below workouts.
HTML
Angular
But the issues I faced was while parsing the json response to auto complete the search it's not worked. Please find the attached snapshot you will get more idea. please help me to solve this issues and correct me If I did any wrong.