Hey everyone.
I am in a situation, where I have a number of the same modals for settings for a number of graphs. These modals get dynamically generated each time a graph is added, to have a settings modal associated with it. In these modals, I have a list of buttons that also get dynamically generated based on some conditions. I then run into an issue with callbacks, since i need to always identify, which button was pressed in which modal and it gets a little complicated. I try to solve this issue with having more detailed defined IDs.
’
In the first picture, I am showing how the callback is defined, it is not important what code follows, important thing is that the print statement never reaches, if a remove button (the button in the list that gets dynamically generated) is pressed.
In the second picture I show how the buttons are created when there is the need. My idea was to match all the buttons within a specific modal match is modal’s id and then each button would have its unique identifier, the value in it.
So my thought process is: when remove button is clicked, match the index (modal index) with all of the other components and give me a list of all the n_clicks from the buttons in that modal (button-index: ALL). I have also tried to just slam the ALL wildcard in the index and just get the right list based on the ID that triggered the callback, but none of the mentioned solutions make my remove buttons trigger the callback. ChatGPT suggests its an issue with combining MATCH and ALL wildcards, but not much more information.
Is there maybe another solution to this desired behavior or a fix for my attempted solution? Let me know if you want extra information, it is quite hard to explain
I think I see the point of the post, but I have an issue where the index of other items in the callback share the index of the modal, making the buttons indices {major}-{minor} wont match the other parameters in the callback and thus not get triggered, right?