Insert excerpt | ||||||||
---|---|---|---|---|---|---|---|---|
|
This page is for application designers who want to configure parts of a screen to be visible in specific conditions.
A toggle component acts as a switch to represent:
- on/off
- enabled/disabled
- show/hide
When the application user changes the state of the switch, you can read the state change in a formatting rule and use it to change other components on the screen. For example, you can use a toggle to show or hide part of a screen.
There are prebuilt toggle switches available inIntroduction
Drop-down views can be styled to suit your business requirements. In the below example, row styling has been configured on the view that can be seen in the drop-down.
For creating drop-downs, see Adding a Drop-Down.
View Style Settings
In this example, we will create a number of new styles to achieve the below styling for our drop-down view.
For Grid Row Style, select the
icon to create a new style:Insert excerpt _addIcon _addIcon nopanel true Name:
GridRowHeight
Height:
20px
Insert excerpt _finish _finish nopanel true
For Grid Column Style, select the
Insert excerpt _
addIcon _
addIcon nopanel true
The steps to use a toggle are:
- From the palette, drag a toggle onto the screen canvas.
- For another component on the screen, configure:
- the style to use when the toggle is disabled/off.
- and a formatting rule to use when the toggle is enabled/on; see Applying Formatting Rules.
- In the formatting rule set:
- Rule Expression to
_form.ToggleName
When the toggle is:- enabled/on, it returns true
- disabled/off, it returns false
- Style to the style you want to use when the expression returns true.
- Rule Expression to
Example to Switch View Type
In our Demo CRM application, which is available from the Learning Centre downloads, we have a toggle switch between a card view and a grid view. This is illustrated below.
When the Grid View toggle is disabled, the screen displays a card view of the data:
When the Grid View toggle is enabled, PhixFlow displays a grid view of the data:
Both data views exist in the same location on the screen, but their formatting rules hide them depending on the toggle state.
The screenshot below shows the card view's formatting rule. When _form.GridView
returns true
we apply the Hidden style to the card view.
icon to create a new style:
Name:
GridColumnBorderRight
Border: choose the Split border option
For R:
Enter
1px
For the colour picker, enter the hex code
#bdbdbd
For the line, choose
solid
Insert excerpt _finish _finish nopanel true
For Grid Alternate Row Style, select the
icon to create a new style:Insert excerpt _addIcon _addIcon nopanel true Name:
GridAltRowColour
Fill:
#e8e8e8
Insert excerpt _finish _finish nopanel true
For Row Selection Style, select the
icon to create a new style:Insert excerpt _addIcon _addIcon nopanel true Name:
RowSelectColour
Fill:
#c27ba0
Insert excerpt _finish _finish nopanel true
For Grid Row Hover Style, select the
icon to create a new style:Insert excerpt _addIcon _addIcon nopanel true Name:
GridRowHoverColour
Fill:
#daafc6
Insert excerpt _finish _finish nopanel true
the new ViewInsert excerpt _finish _finish nopanel true