This tutorial will cover the creation of card views and expand upon some of the other features we've seen so far, such as custom actions.
The video recap is as follows:
Create a Card View
- In the right portion of the
Businesses
dashboard create a new Form called:BusinessNotes
- Enter the Settings:
- Tick Auto Size
- Direction:
Column
- Justify:
Flex Start
- Align:
Stretch
- Remove all other Position Settings
- Tick Prevent Dragging
- Open the configuration form for the stream
BusinessNotes
, and bring the new dashboard back to the front - Drag the stream icon from the configuration form onto the
BusinessNotes
Form, this automatically creates a Card View.Tip The card view is created as a form already existed. If no form had existed a grid view would have been created.
- Locate the Card View in the repository
- Set the Name to
Notes
- Tick Use Custom Default Filter
- Next to the Default Filter click on the + button
- Name:
ByBusinessUID
- Filter Details
BusinessUID
equalsBusinesses.UID
- Click abc to let PhixFlow know this is a formula.an expresssion
- Note that default filters can be removed by the user. If you use the Background Filter Rule this will be applied and not be accessible to the end user. The latter is available via the Background Filter Rule section, where a filter Rule can be added.
- Name:
- Create a Default Sort Order
- Tick Auto Size
- Remove all the Position Settings
- Tick Prevent Dragging
- Set the Name to
- Locate the Card in the repository, enter the settings:
- Untick Auto Size
- Direction:
Column
- Justify:
Flex Start
- Align:
Stretch
- CSS Properties:
maxHeight = 300px
minHeight = 50px
- Remove all Position Settings
Configure the Card View Layout
- Drag an Area onto the Card (using shift to embed the area)
- Set the following for the Area:
- Name:
NoteHolder
- Untick Auto Size
- CSS Properties:
padding-left = 5px
padding-right = 5px
padding-bottom = 5px
padding-top = 5px
- Remove all Position Settings
- Name:
Top Portion of the Note
- Drag an Area ono the NoteHolder area and set the following:
- Name:
NoteContent
- Untick Auto Size
- CSS Properties:
border-bottom = 1px solid #9b9b9b
- Remove all Position Settings except Order and Tab Index
- Name:
- Drag a Dynamic Text area onto
NoteContent
area, with apply the following settings:- Name:
Note
- Untick Auto Size
- CSS Properties:
padding-bottom = 5px
- Width:
100%
- Remove all other Position Settings except Order and Tab Index
- Name:
Lower Portion of the Note
- Drag an Area ono the NoteHolder area and set the following:
- Name:
NoteAudit
- Untick Auto Size
- Direction:
Row
- Justify:
Space Between
- Align:
Center
- Remove all Position Settings except Order and Tab Index
- Name:
- Drag a Dynamic Text field onto the area and set the following:
- Name:
NoteByUser
- Name:
- Drag a DateTime field onto the area and set the following:
- Name:
NoteDate
- Type:
Datetime
- Remove all Position Settings except Height, Order and Tab Index
- Name:
Setup a Note Editing Dashboard
- Create a new Dashboard called
BusinessNotesEditor
- Tick Always On Top
- Create a new Form called
AddNoteForm
- Open the configuration form for the stream BusinessNotesstream
BusinessNotes
, and bring the new dashboard back to the front - Drag the attribute
Note
onto the dashboard and set the following:- Width:
100%
- Top:
0px
- Bottom:
45px
- Width:
- Drag the attributes
UID
onto the dashboard and hide the field - Drag the attribute
BusinessUID
onto the dashboard and hide the field- This field will be used to associate the note our notes to a specific business
- Drag an Area onto to the dashboard with the following settings:
- Name:
AddNoteFooter
- Background-Colour:
#
9b9b9b
- Direction:
Row
- Justify:
Flex End
- Align:
Center
- Width:
100%
- Height:
45px
- Bottom:
0px
- Tick Prevent Dragging
- Name:
Setting Up a Custom Insert Action
- Add a button, and set the following:
- Name:
InsertNote
- Action Type: Insert
- Name:
- Open the stream configuration for
Business Notes
- Go to the Actions section
- Press + to add a new action
- In the action configuration form, enter the following settings:
- Name: AddNoteCustomAction
AddNoteCustomAction
- Display Name: Add Note
- Context Parameters
- Tick Include Previous Context Parameters
- In the Stream Action Rule Items section use the following settings:
- Add a Stream Action Rule using the + button
- Add a Stream Action using the + button
- Name:
AddNoteAction
- Stream Item Action:
Update
- Filter Type:
Selected Items
- Tick Copy Values By Name
- Attributes to Update:
NoteDate = now()
- Automatically sets the time to now.
NoteByUser = _user.name
- Sets the note author to the current user.
BusinessUID = _context.BusinessUID
- Sets the UID of the Business this note will be associated to. We will set this up later.
- Save Your changes
- Save your changes
- Name:
- In the Action Completion: Tick Close Parent Dashboard
- Name: AddNoteCustomAction
Tip |
---|
Copy Values by Name updates the underlying stream with values types into a form if the names of the fields match. All standard actions will do this. When you add a custom action to update or insert, it is important that you tick this, otherwise the form will not continue to work as it currently does, and you will not be able to easily as new fields as you have done so far. |
Setting Up a Custom Open Dashboard Action
- Update the button Label to Insert
- Drag the action from the stream configuration onto the button Addin button
Add
on your edit form - Save the changes.
- Open the stream configuration for
BusinessNotes
- Go to the Actions section
- Press + to add a new action
- In the action configuration form, enter the following settings:
- Name: OpenAddNote
OpenAddNote
- Display Name:
+
- Open the Context Parameters section
- Click the + button
- Name: BusinessUID
- Expression: Businesses.UID
- This is constructed using the name of the element holding the information and the attribute name on that element
- i.e. <<element>>.<<attribute name>>
- To find the element name, right click and select Show Element Details to obtain the name of an element.
- This is constructed using the name of the element holding the information and the attribute name on that element
- Save the changes
- Action Completion
- Tick Open Post Dashboard
- Select
BusinessNotes
and drag it into the window
- Name: OpenAddNote
- Save the your changes.
Building Note Actions
- Drag an Area onto the
BusinessNotes
Form and apply the following settings: - Name:
NotesFooter
- Enter the Style Settings:
- Background-Colour:
#
9b9b9b
- Untick Auto Size
- Direction:
Row
- Justify:
Flex End
- Align:
Center
- Height:
45px
- Remove all the other Position Settings
- Background-Colour:
- Drag a Button onto the new area and apply the following settings:
- Name:
OpenAddNote
- Action Type:
General
- Action:
OpenAddNote
- Width:
35px
- Name:
- Set the Label value to +
Go into App Mode to test the changes and the new dashboard.