9. Grid Actions and In-Grid Editing
- Anthony George
Owned by Anthony George
Grid Buttons
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 .
- 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 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.
- Name,
- 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.
- 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, OK.
- Name,
- From the Actionflow toolbar add an Open URL action.
- Name,
Make Call
- Click Create Action.
- Name,
- 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. - Finally,
- In the CSS Properties, click .
- CSS Tag,
opacity
. - Value, 1
- Save all changes.
- Name,
- 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 Show the View Configuration.
- In the Advanced section, tick Auto 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.
- Save your changes.
Testing
Switch to app mode and add a website to a company. Note for a save to occur the user must click out of the cell they updated.