Hey all,
I’ve been hitting my head against the following problem. I have a layout with a bunch of elements whose ‘value’ I target using States within a callback. I wanted to make it so the callback targeted the ‘children’ attribute of the parent element containing all the elements being targeted by the callback. So the callback is essentially of replacing the chunk of layout containing all the relevant elements to itself. Unfortunately things are not happy on the client side in this scenario, as when I initiate the callback I get “TypeError: undefined does not have a method named “concat”” in my browser console. I presume this is because I’ve removed all the elements that were bound to States but re-inserting a component tree containing elements with the same IDs doesn’t recreate the bindings. (?)
I then moved on and tried to do this differently using app.layout set to a function, so that the layout would be produced dynamically. Unfortunately it seems like associating any callbacks with elements in this dynamic layout still breaks things, as I get “Error loading layout” in the browser itself, and the same “TypeError: undefined does not have a method named “concat”” in the console.
Is it not possible to target callbacks at elements in a dynamic layout produced using a function? If so, it doesn’t seem like there’d be much point to using this.
(Also, I should note that I’m stretching Dash a bit for what it’s meant for, as the layout I need to regenerate is populated from a global variable – a no no, I’m aware, but there’s only ever going to be one user of the app at a time, so I think I should be able to manage those complexities of state)