vivek bhoraniya
vivek bhoraniya

Reputation: 1535

How to display bunch of data in tableview

In my app I have 800 000 data in server which I have to display to user. User can also search from those data. I really got confused what to do here now. How to achieve this functionality.? I am trying to load first 50 data to table and then at top part there is search bar from that user can search data but user can search by writing approximate word also (i.e if user wrote "bcd" then it will return all data having "bcd" combination). Can anyone suggest me something that will help me to get out of this situation.

Upvotes: 2

Views: 393

Answers (3)

jogshardik
jogshardik

Reputation: 1456

You have to do pagination here without it you can't get that much data if you do that then your application will be crash. Fetch some data from the server like 30 or 40 and when you reach at 30 request for next 30 data. Then you can meet the application need.

Upvotes: 1

k-thorat
k-thorat

Reputation: 5123

You will have to use pagination, I don't see any other way you can do this without eating up lot of memory or the elegant way and worst case sporadic crash.

You can do the pagination in the browse and the search both. To avoid delay's for user you can preload data. e.g. for pages of 200 records, when user reaches to 150 you start fetching data for next page.

Also if your local/web server is taking more than min to load. you have serious problem on the server, That needs to be fixed. No user will wait for min to reload or get the new data. I am not expert on the servers/networking but it should not take more than 10-15 secs.

Think about search logic as very similar to the browsing all data.

  • Search/Browse both needs paging
  • Browse returns all the data in pages
  • Search returns specific data in pages
  • Search/Browse proloads data after user reaches certain point

Upvotes: 0

khushbu
khushbu

Reputation: 222

You need to use pagination in your application .without pagination if you got 8 lakhs data in one shot then your application might be crash. every time send request to server like"abc" server get first 10 data from result and return those data. now for second request server will return 11 to 20 records from resultant data

Upvotes: 1

Related Questions