How to use checkbox after sorting a list of items being read from a local file(.txt) in json format

Hello everyone,

Well I know the title of the Topic is quite long :stuck_out_tongue: .

I am trying to import data using a local (.txt) file which has a json text.
Everything works fine, I am reading this data and binding each field(text…etc) to the right place.
However, I noticed when I SORT/SELECT elements from the list (when page mounted), I cannot check/uncheck the checkboxes.

Here is a sample picture of the APP :

I am assuming it may be a bug or something … idk.

Thank you!

Hi, that’s because you’re no longer listing the original data, rather a filtered / altered version of it, so the changes cannot be made back into the original, if that makes sense. If you want to filter items, you could tie the visibility of a list item to the chosen category, like pageVars.chosenCategory === item.category. That way the list itself is not altered (so checkboxes should work), but the items you don’t want to show are hidden.

1 Like

Thank you for that suggestion.
But when I was trying to implement it, it worked with a list with few items.

In my case, I am trying to read a list that have 42 task (each task have 10 fields).
so when loading the page, these tasks should be divided into 6 sections, using the method you provided. This leaded to app crash after few seconds when I open the page.

is there any alternative to solve this ?

Hi, I would recommend that you try placing your repeating components inside a Recycler view component, that should improve the performance as it only loads the ones that are currently being rendered on the screen and some of the next, defined by “render offset” property.

1 Like