<< 点击显示目录 >> 主页 mappView帮助助手 > mapp View帮助信息 > Widgets > Containers > GridLine > Concept |
This section contains additional information about the concept of widget "GridLine".
There are two ways that "GridLineItem" widgets can be expanded or collapsed:
By clicking on CollapseImage or ExpandImage
For this possibility, an image is bound to properties collapseImage and expandImage. At runtime, you can click on the images and widget "GridLineItem" will be expanded or collapsed accordingly.
Using actions
As a second possibility, the actions of widget "GridLine" can be used. (Expand, ExpandAll, Collapse, CollapseAll).
In this example, widget "GridLineItem" is expanded by clicking on it. All existing "GridLineItem" widgets are collapsed with a click of a button.
<!---Expand GridLineItem1-->
<EventBinding>
<Source xsi:type="widgets.brease.GridLineItem.Event" contentRefId="ManTestContent" widgetRefId="GridLineItem1" event="Click"/>
<EventHandler>
<Action>
<Target xsi:type="widgets.brease.GridLine.Action" contentRefId="ManTestContent" widgetRefId="GridLine_test">
<Method xsi:type="widgets.brease.GridLine.Action.Expand" item="GridLineItem1"/>
</Target>
</Action>
</EventHandler>
</EventBinding>
<!---Collapse All items-->
<EventBinding>
<Source xsi:type="widgets.brease.Button.Event" contentRefId="ManTestContent" widgetRefId="btn_CollapseAll" event="Click"/>
<EventHandler>
<Action>
<Target xsi:type="widgets.brease.GridLine.Action" contentRefId="ManTestContent" widgetRefId="GridLine_test">
<Method xsi:type="widgets.brease.GridLine.Action.CollapseAll"/>
</Target>
</Action>
</EventHandler>
</EventBinding>
There are two possibilities for changing the arrangement of the elements at runtime.
Drag-and-drop
In order to use the drag-and-drop function, you must switch to modify mode. This means that action Modify should be triggered with argument true.
If modify mode is active, all "GridLineItem" widgets must be collapsed. The user can then use drag-and-drop to rearrange the elements as desired.
Modify mode is ended using argument false.
In order to save the arrangement of the elements, a variable must be bound to property itemConfiguration.
Property itemConfiguration
A string variable can be attached to property itemConfiguration, which can be changed in the application.
A JSON string must be specified in the variable, which can appear as follows:
[{"wRef":"GridLineItem1","s":1},{"wRef":"GridLineItem3","s":1},{"wRef":"GridLineItem2","s":0}]
wRef: Defines the name of the widget
s: Defines whether the GridLineItem is collapsed (0) or expanded (1)