Part 1
Widget Connector | ||||||
---|---|---|---|---|---|---|
|
...
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.
To recap the steps in the video::
Create a Card View
- In the right portion of the
Businesses
dashboard create a new Form called:BusinessNotes
Enter the Settings calledBusinessNotes
and set:- Tick Auto Size: tick
- Direction: Column
- Justify: Flex Start
- Align: Stretch
- Remove all All other Position Settings should be blank.
- Tick Prevent Dragging: tick
- 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 that already existed. If no form had existed, a grid view would have been created.
- Locate Find the Card View in the repository and set:
- Set the Name to:
Notes
- Tick Use Custom Default Filter: tick
- Next to the Default Filter, click on the + button.
- Name:
ByBusinessUID
- Filter Details
BusinessUID
equalsBusinesses.UID
- Click abc to let PhixFlow know this is an expresssionexpression.
- 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 addedcan be removed by the user.
To apply a filter that is not accessible to the user, add a Rule using the Background Filter Rule section.
- Name:
- Create a Default Sort Order.
- Tick Auto Size: tick
- Remove Clear all the Position Settings
- Tick Prevent Dragging: tick
- Set the Name to:
- Locate the Card in the repository , enter the settingsand set:
- Untick Auto Size: untick
- Direction: Column
- Justify: Flex Start
- Align: Stretch
- CSS Properties:
maxHeight = 300px
minHeight = 50px
- Remove Clear all Position Settings.
Configure the Card View Layout
- Drag Shift+drag an Area onto the Card (using shift to to embed the area )Set the following for the Area:and set:
- Name:
NoteHolder
- Untick Auto Size: untick
- CSS Properties:
padding-left = 5px
padding-right = 5px
padding-bottom = 5px
padding-top = 5px
- Remove Clear all Position Settings.
- Name:
In the Top Portion of the Note
- Drag an Area ono onto the NoteHolder area and set the following:
- Name:
NoteContent
- Untick Auto Size: untick
- CSS Properties:
border-bottom = 1px solid #9b9b9b
- Remove Clear all Position Settings except Order and Tab Index.
- Name:
- Drag a Dynamic Text area onto the
NoteContent
area , apply the following settingsand set:- Name:
Note
- Untick Auto Size: untick
- CSS Properties:
padding-bottom = 5px
- Width:
100%
- Remove all other Position Settings except Order and Tab Index.
- Name:
In the Lower Portion of the Note
- Drag an Area ono onto the NoteHolder area and set the following:
- Name:
NoteAudit
- Untick Auto Size: untick
- Direction: Row
- Justify: Space Between
- Align: Center
- Remove Clear 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 Clear all Position Settings except Height, Order and Tab Index.
- Name:
Setup a Note Editing Dashboard
- Create a new Dashboard called
BusinessNotesEditor
and set:- Tick Always On Top: tick
- Create a new Form called
AddNoteForm
. - Open the configuration form for the stream
BusinessNotes
, and 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 our notes to a specific business. - Drag an Area onto to the dashboard with the following settingsand set:
- Name:
AddNoteFooter
- Background-Colour:
#
9b9b9b
- Direction: Row
- Justify: Flex End
- Align: Center
- Width:
100%
- Height:
45px
- Bottom:
0px
- Tick Prevent Dragging: tick
- Name:
...
Setup 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 Click + to add a new action.
- In the action configuration form, enter the following settingsset:
- Name:
AddNoteCustomAction
- Display Name: Add Note
- Context Parameters
- Tick Include Previous Context Parameters: tick
- In the Stream Action Rule Items section use the following settings, set:
- Add a Stream Action Rule using the + button.
- Add a Stream Action using the + button and set:
- Name:
AddNoteAction
- Stream Item Action:
Update
- Filter Type:
Selected Items
- Tick Copy Values By Name: tick
- 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 theBusiness
with which this note will be associated to. We will set this up later.- Save Your your changes to the attributes.
- Save your changes
- to the stream.
- Name:
- In Action Completion, set: Tick
- Close Parent Dashboard: tick
- Name:
Tip |
---|
When you add a custom action to update or insert, it is important that you tick Copy Values by Name. When this option is selected, PhixFlow updates a form with values from the underlying stream with values types into a form if when 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 . If you do not select Copy Values by Name, the form will not continue to work as it currently does, and you . You will not be able to easily as add new fields as easily as you have done so far. |
...
Setup a Custom Open Dashboard Action
- Update the button Label to Insert.
- Drag the action from the stream configuration onto the button
Add
on your 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 settingsset:
- Name:
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 elementi.e. , for example:<<element>>.<<attribute name>>
To find show the element name, right-click and select Show Element Detailsto obtain the name of an element. - Save the changes
- In Action Completion, set:
- Tick Open Post Dashboard: tick
- Select
BusinessNotes
and drag it into the window.
- Name:
- Save your changes.
Building Note Actions
- Drag an Area onto the
BusinessNotes
Form and apply the following settingsset: - Name:
NotesFooter
- Enter the Style Settings:
- Background-Colour:
#
9b9b9b
- Untick Auto Size: untick
- Direction:
Row
- Justify: Flex End
- Align: Center
- Height:
45px
- Remove Clear all the other Position Settings.
- Background-Colour:
- Drag a Button onto the new area and apply the following settingsset:
- 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.
Panel |
---|
Next video: 7. Screen Flow |
...