CARDVIEW DYNAMIC - Deletion of remaining items

Friends, I’m new to Kodular and I have the following difficulty. I created a mechanism with three sets of information that are shown using dynamic cardview. Everything is ok, however every time I click on a different button, cardviews remain that have not been deleted. I can’t understand where the error is, which is most likely known about the functioning of the dynamic cardview component.ALDEIH.aia (897.1 KB)

Please just post an image of your blocks instead of posting an aia.

2 Likes

Peter, thanks for your instructions

complementing the message with the blocks.

I didn’t understood what you want to say…would you like to elaborate…

Thank you for your help. I will try to be more accurate. I have three lists, when I click each button, the previous list should be deleted, but this is not happening.

Means you have 3 list on button click you want to replace cards of list 1 with list 2… and so on…

Am I right?

1 Like

Exact. That’s exactly it, but every time I move from one list to another, empty cardviews are left at the end of the list.

Hi, nikzdreamer2001, any tips?

These days i’m little bit busy because of my exams…
but right now im checking your blocks…

Would you like to send apk file?

apk or aia?

whenever card is clicked call delete_card with passing respective value of tipo

Change your delete_cards procedure…
take for loop from id to 0 with difference -1 and delete card using this logic
when it exits the loop set value of id to 0. and then called list_avisos by passing passed value in delete_cards

Just put list_avisos procedure inside delete_card procedure…
Annotation 2020-06-17 190307

i was asking for apk now i think its not needed…

Nikzdreamer2001, it worked, I subtract instead of adding (see block). However, when I go to another button it deletes the “title” from the cardview.blocks (9)

follow my apk. You can see that title is deleted.

MINHALDEIA_copy_copy.apk (7.3 MB)

Remove set global I’d to 0

I really have a little difficulty with the logic of the blocks. But I’m learning. See, I put the zero and now every time I click, it keeps the last block and includes the rest.

Didn’t get it… what you want to say.

And why are you creating dynamic label for title for 2 times…

You are right about creating two dynamic titles. I already removed.

About the problem.

The logic is as follows. When you click the “admin” button the screen will have cardviews from 1 to 5, when you click the “social” button the cardview will be from 6 to 10 and finally the last button will be from 11 to 15. What is happening is that the logic is in error because it is retaining the last cardview of each list (as shown).