Change Layout property of Group in some specific case


#1

Can we change the layout of Group? For example:

  1. We have some node and GridLayout group
  2. We do something and make that node in group become a tree, group Layout change to TreeLayout
  3. We remove the link and the layout change to GridLayout

Do we have the ability to do that?


#2

So you either want to affect the layout that is the Group.layout by setting some of its properties, or you want to use a different Layout class.

If the choice is data-driven, you can use a Binding on the Group.layout property in your group template, using a conversion function that returns the instance of the Layout that you want to use with the properties that you want.

But if the choice is more dynamic than just looking at the data, I suppose you could implement a listener and then optionally change the value of some Group.layout programmatically.