...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
Insert excerpt | ||||||||
---|---|---|---|---|---|---|---|---|
|
Overview
In a PhixFlow application, you can configure drag-and-drop actions using actionflows and table actions. Some examples of drag and drop actions are:
- Dragging a record from a grid onto a delete area to remove it.
- Dragging a contact from one grid onto a specific company on a company table to move that contact to that company.
- Dragging items into different sections on a Kanban board to change the state of the record. See Making Kanban Boards.
Setting up Drag and Drop
To set up drag and drop on components, a
on the object you are dragging from and a Insert excerpt _drag_type _drag_type nopanel true
Insert excerpt | ||||||
---|---|---|---|---|---|---|
|
For example, to assign a new company to a contact a user creates two grids on a screen
...
The contact and company table have a relationship and linked by a CompanyID field. The contact can be dragged and dropped onto a company to update CompanyID. The contact is the Drag Type and the company grid is the Drop Target.
Defining a Drag Type
- Open the properties for the
...
- view from which data will be dragged.
For example, right-click on the grid and select Show the View Configuration - Navigate to the Actions tab
In
...
Action Settings → Drag Type, select or create a drag type, e.g. Move Contact.
Note This drag type needs to match the drag type defined on the drop target.
If using an actionflow, it is essential to add Drag Mappings to attributes from the source table to attributes used within the actionflow. If using table-actions, skip this step. In this example, we need to know the ID of the contact to be updated. To add Drag Mappings
Open the editor for the Drag Type by clicking on the field label
- Add an attribute and name this ContactID
- Change the Type to Integer
- Save the attribute
- In
...
- Action Settings → Drag Type Mappings, click
to open the mapping popup.Insert excerpt _mapping _mapping nopanel true - Map the ContactID from the Grid to ContactID on the Drag Type
- Action Settings → Drag Type Mappings, click
Components with a drag type can be dragged and dropped onto any component which has a drop target with a matching drag type. It is on the drop target where the action is configured.
Drag Type Properties
Insert excerpt | ||||||
---|---|---|---|---|---|---|
|
Field | Description |
---|---|
Name | Enter a name for the drag type. |
Attributes | Drag type attributes are attributes that can be used within an actionflow. Add attributes here and map them to view attributes under |
...
Action Settings → Drag Type Mappings of the View Properties. |
Defining a Drop Target
- Open the properties for the component where the data will be dropped. In the above example, this would be the Company grid.
- Navigate to the Actions tab.
- In Drop Targets, click
to create a new one.Insert excerpt _new _new nopanel true - Provide a descriptive name, such as Move Contact to New Company
- Select the drag type (e.g. Move Contact) which matches the drag type of the component being dragged.
- Select the action to run when something of the same drag type is dropped onto this component.
- If setting up a table-action see Using the Drag Type and Drop Target in a Record-Action below.
- If setting up an actionflow, see Using the Drag Type and Drop Target in an Actionflow below
Drop Target Properties
Insert excerpt | ||||||
---|---|---|---|---|---|---|
|
Field | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|
Name | Enter a name for the drop target. | ||||||||
Drag Type | Select the drag type, or
| ||||||||
Action | Select the action to perform when items are dropped on the target view. |
Using the Drag Type and Drop Target in an Actionflow
Drag Types and Drop Targets can be used as inputs into an actionflow. To configure an actionflow to move a contact to a new company
- Click Connect under Connections on the actionflow to create a new input
- Select the Drag Type (e.g. Move Contact). This represents the Contact that is being dragged and the record that needs to be updated. This is what is driving the actionflow.
- Map the Drag Type attribute (e.g. ContactID) to the interface of the actionflow.
- Click Add under Connections on the actionflow to create a new connection for the Drop Target. The actionflow needs to lookup the new CompanyID from the drop target.
- Name the connection point lu
- Select a Lookup connection. To learn more about lookups,
...
- see Using Lookups in Actionflows.
- Click Create Connection Point
- Select the Drop Target (e.g. Update Company). This represents the Company that is being dropped onto.
- Map the required attributes to the interface of the actionflow. In this example, only CompanyID is required.
- Create a
node by dragging and dropping from the toolbar.Insert excerpt _actionflow_calculate _actionflow_calculate nopanel true - Name this Move Contact
- Connect the calculate to the input, in, of the actionflow by dragging from in to Move Contact.
- Map ContactID to the calculate node
- Connect the calculate to the lookup, lu, of the actionflow by dragging from lu to Move Contact.
- Click Create Lookup
- Name the lookup lu
- Map CompanyID to the calculate node
- Open the editor for the
by clicking on the node.Insert excerpt _actionflow_calculate _actionflow_calculate nopanel true - Add a calculate attribute
- Name NewCompanyID
- Type String
- Order 1
Expression
Code Block lu.CompanyID
- Create a
node by dragging and dropping from the toolbar.Insert excerpt _action_save _action_save nopanel true - Name this Save Contact
- Select the Contact table
- Open the editor for the
node.Insert excerpt _action_save _action_save nopanel true - Click
to open the attribute pickerInsert excerpt _attributes _attributes nopanel true - Drag and drop the CompanyID onto the Save Attributes. The ContactID (primary key) of the table should be added by default.
- Click
- Connect the
to theInsert excerpt _actionflow_calculate _actionflow_calculate nopanel true Insert excerpt _action_save _action_save nopanel true - Map ContactID to ContactID
- Map NewCompanyID to CompanyID
The actionflow is now configured.
Using the Drag Type and Drop Target in a Record-Action
If using a table-action on the drop target you can use the following to define the data.
- Record-Action → Basic Settings → Filter Type options:
- Dragged Items defines what data is expected from a dragged
- Drop Target Items defines what to do with the data.
In addition, you can use the following variables in context parameters and record-action attribute expressions:
- _dragSource In a drag action, all information from the source is passed to the drop target. Use this variable to select the specific information required by the target.
- _dropTarget specify the location where data can be dropped.
- _dropPosition specify drop target co-ordinate values.
Learn More
For links to all pages in this topic, see Connecting Events to Actions
Insert excerpt | ||||||
---|---|---|---|---|---|---|
|