What is the best way to make the number of views on a carousel dynamic? For example: I have 4 views for 4 different machines, but I want to disable the view for a machine if that particular machine is not running.
And what do you want to happen if someone has that view open?
Is there a chance they won't notice that the view has switched and make a mistake as a result?
Why not leave the number of views the same but switch out the views for a "Machine Offline" view?
I do something like this, there might be a better way... but I created a custom prop which defines the instances. I add one prop per instance that defines visibility (true/false). I then bind the actual instances prop of the carousel to this custom prop and using a transform I only pass the instances that should be visible.
Hope that made sense.
Edit, in the custom prop, I can bind the visible prop to something that could make it dynamic.
This is a dashboard display that has autoplay enabled, and cycles through each view that shows the status of that machine. I would like to disable the view for a machine that is not running so operators don't have to wait for the carousel to cycle through machines that are not running to see the ones that are. I hope that makes sense?
What type of transform are you using? And are you binding to the views prop or each individual view?