Skip to content
Advertisement

Not Showing Correct Position While Searching in Listview

JavaScript

In this program I give apple as 0th item and first item,banana as 2&3rd item and so on.. but while searching I want to show papaya as 17th or 18th based on which papaya I click .

without searching it will correctly show the number of fruits location.but while searching it will show if 4 item shown in list view it toast 0,1,2,3 based on clicking.Please help me to figure out

Advertisement

Answer

If you do a search for example using ‘P’, pineapple and papaya will be returned. Initially before search Pineapple is positions 4 and 5 and Papaya is 17th and 18th. But when you search only four results will be returned so Pineapple will be position 0, 1 and Papaya will be position 2 and 3. The position of items changes with the number of items in the list. So the behaviour you are seeing is the expected and correct one.

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement