DetailsView

DetailsView is a container that implements the ViewsContainer interface.To create a DetailsView, the function is used

func NewDetailsView(session Session, params Params) DetailsView

In addition to child Views, this container has a "summary" property (Summary constant).The value of the "summary" property can be either View or a string of text.

The DetailsView can be in one of two states:

  • only the content of the "summary" property is displayed. Child Views are hidden and do not take up screen space
  • the content of the "summary" property is displayed first, and below the child Views.The layout of the child Views is the same as ColumnLayout with "column-count" equal to 0.

DetailsView switches between states by clicking on "summary" view.

For forced switching of the DetailsView states, the bool property "expanded" (Expanded constant) is used.Accordingly, the value "true" shows child Views, "false" - hides.

You can get the value of the "expanded" property using the function

func IsDetailsExpanded(view View, subviewID ...string) bool

and the value of the "summary" property can be obtained using the function

func GetDetailsSummary(view View, subviewID ...string) View