TableView by ken

Thanks a lot . However, if i wish to add tinydb inside to store data. how should i do to display the previous stored database?

This should handle tinydb storage of the data list - it does not include the "DATE" header row

TableViewExampleV3.aia (25.2 KB)

1 Like

Thanks. It helps a lot.

Hi tim, can i have sample of this if i would like to preview the data on another screen? and what if i wish to delete the data on the another screen using the tableview. Thanks in advance

You just use the same tinydb/namespace on the other screen to access the data, and load this to your tableview datastring as in my example.

Delete data "using tableview" ? Please explain more on what you are trying to achieve. I see you have also asked the same question here

I suggest you provide an aia project that demonstrates the problem, so we can suggest a solution

....sounds the same as

TableViewExampleV6.aia (27.5 KB)

That example does not contain any blocks for clearing the tinydb ?

You also do not update the data tag/value in tinydb after you delete an item from the list, is that all you want to do ?

yes. That's what i wanted to do. In this case, instead of clearing the tb i wish to select certain row to delete. Is that the right way?

On Screen1 you need

and your button click should be like this

on Screen 2

your Tableview click should look like this:

Strange. I did what u mentioned. After the row get deleted, when i back to screen 1 and key in new value again, and when i visit back screen 2, the deleted row is still in the tableview together with the new value.
TableViewExampleV6 (1).aia (27.4 KB)

Working OK here

Yes it did work on AI companion. But when i extract to apk file, it run the otherwise.

Ah, yes. When compiled Screen1 does not initialise again if you use close Screen on Screen 2. To overcome this add the getValue block to the button click event

1 Like

Latest update, when the row get deleted at screen 2, and i need to close the app. Then restart the app and key in the new value, only screen 2 will show latest data.

Another great reason to use virtual screens, then this all happened on the one real screen :wink:

1 Like

Thanks for ur help TIM. Is there anyway i can learn how to virtual screen?
Thanks

also

Use different screens wisely

If you decided to use different screens, then you should switch them correctly, else you will run out of memory after a while...      
<a href="https://puravidaapps.com/manager.php" target="_blank"

rel="nofollow noopener">The recommended method of switching screens in App Inventor

(Thanks Taifun)
 
Also see demo: multiscreen.aia
 
1 Like

Hi TIM, can i know what's the difference outcome of this two different kind of block ? I just change the way how to store the TinyDb.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.