Get the index of current repeater item
for my case i want to get the index of my repeater item
as i have two repeaters
platforms
products
when i add a platform
i want to set the product for the platform at the same index in products repeater
i dont want to iterate over the platforms repeater array and get the index!
i also want to remove the product if the platform is removed but afterStateUpdated hook is not called on delete of repeater items
i am using AW TableRepeater
@awcodes
as i have two repeaters
platforms
products
when i add a platform
i want to set the product for the platform at the same index in products repeater
i dont want to iterate over the platforms repeater array and get the index!
i also want to remove the product if the platform is removed but afterStateUpdated hook is not called on delete of repeater items
i am using AW TableRepeater
@awcodes
Solution
Table repeater just uses filaments repeater under the hood. But I’m afraid you are going to have to iterate since the array keys for repeaters are UUIDs. Unless you extend the TableRepeater and provide your own hydration and dehydration.