tableView preloading params data

Hi everyone,

I am battling with a very annoying tableView problem. 

To start off with, I am aware that tableViews were designed with a lazy-load feature, which loads tableView data when they become “visible” on the screen. This is great, however, because it is not preloading all the data from all my rows, I cannot access all my data when I need to.

For example, I have a search feature that allows me to search for certain rows. Let’s say my list contains 100 rows. The search feature will only see data that has been rendered “visible”. The rest of my data is unreachable, because tableView has not preloaded all that data. It loads it all on the fly.

Is there a way I can preload all my tableView data?

I know there are a few threads out there about preloading images, but I need all my params preloaded, not only images.

Any advice would be greatly appreciated!

Thanks!

David

Let me try to get you to see tableViews a bit differently.

In development there is a programming pattern called MVC - Model-View-Controller. The principle of MVC is that your data (the model) and the code that maintains it should be it’s own independent system. The View (what your user sees) is just a data display tool. It’s actually unaware of the data/model.  The two talk to each other through a Controller - code that bridges the two.

We can’t exactly do a full MVC setup with tableViews, but you can use that mentality when thinking about the process.

Normally you will have a Lua table that holds all your data records (or an SQLite database). Then your tableView is a visual representation of the X number of visible rows into your real data. In your case you want to search for records but instead of looking through the tableView for your records, you would search through your data table for records and then re-render the tableView with that now restricted number of records. 

That way you are not fighting with the tableView’s row culling. TableViews as long as your not packing hundreds of records into them will update in a single frame so it’s perfectly valid to do your search, delete all the rows and just reinsert your search results.

It’s a different way of looking at it, but I firmly believe the tableView should not be your data.

Rob

Solved! Thanks!

Let me try to get you to see tableViews a bit differently.

In development there is a programming pattern called MVC - Model-View-Controller. The principle of MVC is that your data (the model) and the code that maintains it should be it’s own independent system. The View (what your user sees) is just a data display tool. It’s actually unaware of the data/model.  The two talk to each other through a Controller - code that bridges the two.

We can’t exactly do a full MVC setup with tableViews, but you can use that mentality when thinking about the process.

Normally you will have a Lua table that holds all your data records (or an SQLite database). Then your tableView is a visual representation of the X number of visible rows into your real data. In your case you want to search for records but instead of looking through the tableView for your records, you would search through your data table for records and then re-render the tableView with that now restricted number of records. 

That way you are not fighting with the tableView’s row culling. TableViews as long as your not packing hundreds of records into them will update in a single frame so it’s perfectly valid to do your search, delete all the rows and just reinsert your search results.

It’s a different way of looking at it, but I firmly believe the tableView should not be your data.

Rob

Solved! Thanks!