StackLayoutView - is there a way to add a new Stack? #3110
-
IntroductionI'm using the StackLayout in a diagram, and so far its going well. I can manipulate the items on the stack at runtime myself quite nicely, and use layoutView.model.update() to have it update the display. Inserting new elements is done simply by creating them, and ensuring stackindex and stackElementIndex attributes are defined. But the one thing I can't work out is how to add a new Stack to the diagram at runtime, without forcing the whole diagram to be redrawn from scratch? That is, if I define the StackLayout as having 4 stacks, and then over the course of the user creating new items, I find I need a 5th stack (in this case, making the diagram wider instead of deeper being preferable for my UI design), how do I do this? The API describes an insertElement() method for the StackLayoutView, but there does not appear to be an equivalent insertStack() method? For the amount of data I'm showing, there isn't a real speed issue, I'd just like to know if there is a better alternative? Steps to reproduceNo response Restrictions & ConstraintsNo response Does your question relate to JointJS or JointJS+. Select both if applicable.JointJS+ |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
Hello! You can change number of stacks in the model's attribute and then you can call update. This will create extra space in the direction of the layout where you can drop additional elements: |
Beta Was this translation helpful? Give feedback.
Hello!
You can change number of stacks in the model's attribute and then you can call update. This will create extra space in the direction of the layout where you can drop additional elements: