We can embed actions within a grid to perform specific activities, such as deleting the record or sending an email. For our example, we will enable users to click a button and make a call.
- On the Companies grid click Telephone Button.
- We will set Label to
Call,
as it will be clearer to our users. - Click the Action tab.
- Action Method, Actionflow.
- Actionflow, click
Insert excerpt |
---|
| _addIcon |
---|
| _addIcon |
---|
nopanel | true |
---|
|
. - Name, CallCompany.
- Click Confirm.
- The actionflow will open. We will look at actionflows in more detail later in the course. Here we will set up a simple actionflow:
- Click on Connect, in the dialogue that opens click Companies. This tells PhixFlow we need data from the companies grid.
- Click Connect Input.
- In the mapping screen that opens, drag Number to the right-hand side and click Confirm Mappings, as illustrated below. This creates an input mapping attribute that the actionflow can use:
- From the Actionflow toolbar add a Calculate action.
- Name,
callDetails
- Click Create Action.
- Now we need to connect the Input Connection to the Calculate action. Click and hold on the input connection point and drag it over the Calculate as illustrated here:
- Click on the pipe between the two items.
- The mapping screen appears, drag Number to the right. This will allow us to work with the incoming attributes within the calculate action node.
- Then click Confirm Mappings.
- Click on the Calculate action, and in its properties click add in the Calculate Attributes section.
- Name,
CallNumber
. - Expression,
"callto:" + in.Number
- Save your changes,
Insert excerpt |
---|
| _finish |
---|
| _finish |
---|
nopanel | true |
---|
|
.
- From the Actionflow toolbar add an Open URL action.
- Name,
Make Call
- Click Create Action.
- Connect the action. Hover over CallDelatils and click out, move your mouse over MakeCall and click, as illustrated here:
- In the mapping screen that opens, drag CallNumber to URL.
- Click Confirm Mapping.
- To access the mappings at any point click the pipe connecting the two action nodes.
- Close the Actionflow.
- On the view attribute TelephoneButton, we see the actionflow has been set.
- It is recommended that an icon be set for the action button to indicate its purpose.
- Create an Icon Style
- Name,
TelephoneCall
. - Background Image, add the phone-call.svg icon from the zip downloaded earlier.
- Background Repeat,
no-repeat
. - Background Position,
center
. - Background Size,
contain
. This resizes the image to make it fit into the available space and is a useful CSS property. - Then click .
- Finally,
- In the CSS Properties, click
Insert excerpt |
---|
| _addIcon |
---|
| _addIcon |
---|
nopanel | true |
---|
|
. - CSS Tag,
opacity
. - Value, 1
- Save all changes.
- If you lock the screen, clicking the call button will open your computer's default call software.
Check Point
The screen should look similar to this:
In-Grid Editing
PhixFlow can be configured to allow users to make edits to records directly in a grid.
- Open the View Configuration for the Companies grid.
- Right-click and select
Insert excerpt |
---|
| _view_show_config |
---|
| _view_show_config |
---|
nopanel | true |
---|
|
.
- On the
Insert excerpt |
---|
| _property_tabs |
---|
| _property_tabs |
---|
name | action |
---|
nopanel | true |
---|
|
, Action Settings section, toggle on Insert excerpt |
---|
| _toggle_on |
---|
| _toggle_on |
---|
nopanel | true |
---|
|
Fit to available spaceAuto Save.- This will automatically save any changes made in the grid, however, it is possible to specify an action that goes beyond a simple save such as performing validation of input.
- In the View Attributes section, double-click Web.
- In the Grid Settings section, untick Read Only.
- This allows us to type into the field directly.
- Relational attributes will appear as a drop down list. Adding non-primary table attributes from a related table onto the form will be added as Read-Only by default.
- Save your changes.
Testing
Switch to
Insert excerpt |
---|
| _app_mode |
---|
| _app_mode |
---|
nopanel | true |
---|
|
and double-click a cell in the Website column to add a website to a company. Note for a save to occur the user must click out of the cell they updated.