Scenerio is that we are having a page in which the whole data will load in a single page, at a time limited data is there on the screen but as we scroll down the scroll bar other data will populated dynamically, the case is that we do not know the exact amount of data we are having.I want to search for an attribute in the whole data if I'll found the data I can simply break it from my code but if the searched attribute is not present then how I can know whether I have iterated threw all the search results?
I am having no clue how can i procced ?
Consider creating a sentinel value/node to represent the end of the real data. The code that is handling the dynamic loads simply returns real data over and over until it runs out, at which point it returns a special value representing the sentinel. The client knows to never display the sentinel, and also knows that once it comes in, you are done and can stop fetching any new data. Your search can go through all the received data, and if it encounters the sentinel, it is done, if not, you know there might be more dynamic data to fetch.