Hello, I am trying to construct the UI where I have a list of items replicated by the repeater block. Then user can switch to selection mode and a checkbox will appear next to each row of item. By ticking the checkbox they are then selecting them for an action, such as to delete them.
Unfortunately I have fallen at the first hurdle, which is how to toggle the visibility of cells within a Repeater Block. Using the normal Component visibility toggle seems to generate an error “sdk.js:16 Uncaught TypeError: Cannot set properties of undefined (setting ‘display’)”
And the likely follow up question is how do I know which row has been selected? I don’t think the row itself contain that data, right?
Attached image is what I tried to do & the codeless for activating the toggle.
It’s hard to understand from your example.
For more precise support, create a simple example. Then provide us with the appId and the page name from this example so we can play with it.
As I understand it, you want to on click the button (which, as I understand it, is not in the repeater) checkboxes to appear in repeater item. It’s not clear if you want to show checkboxes for all rows or for a specific row?
Hi @viktor.liablin , Sorry if it was not clear before. I have taken your advice and created a simple example. On top of that I have recorded a 3min video to show precisely what I have trying to achieve (and how I’m failing )
I improved your demo.
This is a draft version to show the way.
Ideally, don’t use the page data. It’s better to put everything in the block component with the “Data Container” property as “true” and use “Block Data” instead of “Page Data”.
In my example logic, there is a weak point in the identifiers for repeated items. It was made on the “knee”. If you delete an item and then add it, the two items will have the same ID. The simplest option is to create a number variable “id” in the page data and take it from there. Each time you add an item, increase the ID in page data by 1.