Overview
PhixFlow can display any Table data as a grid on GUI screens. This page will show you how to add data as a grid to any screen, using a worked example of creating a grid of employees from various companies.
The data used on this page is available from the PhixFlow Learning Centre.
Creating an Employees Grid
Once you have a screen created it is simple to add any data to it. To add data:
- Click List Tables
- Drag and drop the desired table onto the screen. In this instance, the Employees table is dragged onto a screen.
- PhixFlow then asks how to display the data using:
- Click Grid
- The attribute picker should then appear. Drag and drop the attributes to display directly onto the grid.
Marking Columns as Editable
By default all grid attributes are read only. Grids can be made editable by
- Click on the attribute column header to open its property editor
- Open Grid Settings
Untick Read Only
Strings, Bigstrings, Integers, Floats and Decimals allow users to type to change its value
Dates and Datetimes have a date picker to change its value
Display name attributes will automatically appear as a drop down. Selecting a different value, e.g. Company, will automatically update the ID stored in the foreign key attribute
Saving data
To save changes to editable attributes
- Right click on a grid and Show the view configuration
- Open the Advanced section
- Tick Auto Save
This will automatically save any changes made to the grid. An action can be added as a save action below this field if required.
Drop downs
Any attribute can have a drop down added for a user to select a value. See View Attribute.
Attribute Column Formatting
Attribute columns displayed on a grid can be styled to improve their display to users.
Labels
Some attributes may have technical names that make no sense to users on the front end. To relabel an Attribute
- Click on the attribute column header to open its properties
- Open the section Grid Settings
- Add a label to the field Label
It is possible to group attributes together using the label. In the Employees grid we can group and relabel the attributes first_name and last_name.
- To first_name add
Name, First
- To last_name add
Name, Last
Any attributes that are adjacent to each other with a matching label before a comma will group.
Hiding columns
Some columns might not make sense to users on the front end but are important for functionality, for example the primary key of the table. To hide a particular attribute
- Click on the attribute column header to open its properties
- Open the section Grid Settings
- Tick Always Hidden
It is also possible to conditionally hide a column. To conditionally hide a column
- Click on the attribute column header to open its properties
- Open the section Grid Settings
Add an expression to Hide if evaluates to true, for example
_client.mobile
This expression will hide a column if the screen is being used on a mobile device.
Column Widths
There are multiple ways to change the column widths. To change widths using the editor
- Click on the attribute column header to open its properties
- Open the section Grid Settings
Add a number, e.g. 100 to Grid Default Width (pixels). The column will then always be 100px. Or,
- Add a number to Minimum Width. Adding 100 to Minimum Width will mean that the column will not be smaller than 100px wide, but will stretch to fill the available space on larger screens.
Alternatively, if grid columns are resized directly on the grid when the screen is unlocked and the screen is then locked again, PhixFlow will remember these widths and set the Grid Default Width (pixels) to that size.
Reordering columns
The order the attributes are displayed on a grid can be changed in the following ways
- Changing the Order field on the attribute editor
- Dragging and dropping an attribute to move it directly on the grid
- Dragging and dropping an attribute to move it on the view editor
Number and Date Formats
Numbers and dates can be reformatted on the grid by adding a number or date format. For example, a company might prefer a date to be formatted as 01 Jan 2000 instead of 01/01/2000. To apply a number or date format
- Click on the attribute column header to open its properties
- Go to the section Stream Attribute Details under Basic Settings
- Select or add a format.
For more information see Date Time Format and Number Format
Formatting Rules
It is possible to add formatting rules to grid attributes to change their styles based on an expression. For example, the Companies table has a Status attribute which a user might want to be green if its value is Approved. To add this formatting
- Click on the attribute column header to open its properties
- Go to the section Formatting Rules
- Click Add New
Add the expression
_current.Status == "Approved"
This will apply the attached style when the status is Approved.
- Add or select a style
- Click Save
For more information on using expressions, see Expressions and Scripts.
More Information
- Filtering and Sorting Grids and Charts
- Formatting and Styling Grids and Charts
- Relational Views
- Actions on Grids and Charts
- For a complete list of view properties and their functions see View.