Introduce about fields, widgets and views¶
In Viindoo Customizer, there are three key concepts: fields, widgets, and views:
Fields: Fields represent the data elements or attributes of a particular object. Fields determine the structure and content of the records in a database table. With Viindoo Customizer you are allowed to create and modify fields to tailor your application to your specific business needs. By customizing fields, you can capture and store the information that is relevant to your organization.
Widgets: Widgets are the user interface components used to display and interact with the data in fields. They provide different ways to present and manipulate data in a user-friendly manner. You can configure widgets for your fields to enhance the user experience and ensure that data is captured accurately.
Views: Views define how data is displayed and organized in the applications. A view is a visual representation of one or more records that allows users to interact with the data.
Requirements
This tutorial requires the installation of the following applications/modules:
Fields and Widgets¶
Viindoo Customizer supports many types of fields. A new field is created from one of the tiles of the Add tab (Text, Multiline Text, HTML, Integer, Decimal, Monetary, Checkbox, Date, Date & Time, Selection, Priority, Tags, Many2one, One2many, Many2many, File, Image, Signature, Reference). The Widget list on the Properties tab of a field then offers the widgets that suit its type, shown as Name (technical name).
Basic fields and their widgets¶
Text and Char¶
Text (the Multiline Text tile): The field is used for longer text containing any type of character. Two text lines are displayed on the UI when filling out the field. The widgets have supported includes:
Ace Editor (ace): A code editor for the text.
Text (char): A single line of text.
Multiline Text (text): Display the text on several lines when filling out the field.
Text (char_emojis) and Multiline Text (text_emojis): Display the text when filling out the field and you can choose more emojis.
Multiline Text (sms_widget): If enable SMS to add an option to send an SMS directly from Viindoo.
Char (the Text tile): The Char field is used for short text containing any character. The widgets have supported includes:
Text (char): Display the text when filling out the field.
Multiline Text (text), Text (char_emojis), Multiline Text (text_emojis) and Multiline Text (sms_widget): The same text with more room, emojis or the SMS option.
Badge (badge): Displays the value inside a rounded shape, similar to a tag.
Image (image_url): The value is the address of a picture, which is displayed.
Email (email): The value becomes a clickable address that opens a new email.
Phone (phone): The value becomes a clickable number to send SMS or make a call.
URL (url): The value becomes a clickable url and can navigate directly to this link.
Copy Text to Clipboard (CopyClipboardChar) and Copy URL to Clipboard (CopyClipboardURL): Users can copy the value by clicking a button.
Stat Info (statinfo) and Reference (reference): Display the value as a statistic of a smart button, or as a link to another record.
HTML¶
HTML: The Html field is used to add text that can be edited using the HTML editor. The widgets have supported includes:
Html (html);
Ace Editor (ace);
Multiline Text (text), Multiline Text (text_emojis);
Multiline Text (sms_widget);
Float and Integer¶
Float (the Decimal tile): It is capable of representing both whole numbers and fractional values with a decimal point. The widgets have supported includes:
Float (float): The value is displayed in a decimal number.
Time (float_time): The value is displayed in time format hh:mm with the limited 59 minutes.
Monetary (monetary): The value is displayed in a monetary number with decimal format.
Percentage (percentage): The value is displayed in a percentage format. Example 7 will display as 700%.
PercentPie (percentpie): The value is displayed in pie format with percentages.
Progress Bar (progressbar): The value is displayed in progress bar format.
Stat Info (statinfo): The value is displayed as a statistic of a smart button.
Integer: It is a type of data field used to store whole numbers (integers). It represents a numerical value with no fractional or decimal part. The widgets have supported includes:
Integer (integer): The value is displayed in a numeric number, no decimal part.
Handle (handle): The grip used to reorder the lines of a list.
Monetary (monetary): The value is displayed in a monetary number.
PercentPie (percentpie): The value is displayed in pie format with percentages.
Percentage (percentage): The value is displayed in a percentage format. Example 7 will display as 700%.
Progress Bar (progressbar): The value is displayed in progress bar format.
Stat Info (statinfo): The value is displayed as a statistic of a smart button.
Date and Datetime¶
Date: It is designed to hold specific calendar dates, including the day, month, and year components. Example: 2024-03-09. The widgets have supported includes:
Date (date): It allows users to choose the date value.
Date Range (daterange): It allows users to specify a start date and an end date, defining a range that encompasses a period of time.
Remaining Days (remaining_days): It displays the number of days left until the date.
Datetime (the Date & Time tile): It is used to store and represent both a date and time together. It combines the components of a date (day, month, and year) with the components of time (hours, minutes, seconds, and optionally milliseconds). Example: 2024-03-09 12:15:00. The widgets have supported includes:
Date & Time (datetime): It allows users to choose the datetime value.
Date Range (daterange): It allows users to specify a start date and an end date included time, defining a range that encompasses a period of time.
Remaining Days (remaining_days): It displays the number of days left until the date.
Boolean¶
Boolean (the Checkbox tile): The boolean field is used when a value needs to be true or false. The widgets have supported includes:
Checkbox (boolean): The value will be displayed as a checkbox button.
Toggle (boolean_toggle): The value will be displayed as a toggle button.
Favorite (boolean_favorite): The value will be displayed as a star of favorite button.
Boolean Icon (boolean_icon): The value will be displayed as an icon.
Selection¶
Selection: The selection field refers to the field type that allows the user to choose one value on the option list. The widgets have supported includes:
Badges (selection_badge): The choosable option will display as the badges.
Radio (radio): The choosable option will display as the radio type and you can tick into these options.
Selection (selection): The normal dropdown type of the option list.
Badge (badge): The chosen option will display as a badge.
Priority (priority): It will displayed as the star indicates the priority.
Label Selection (state_selection): The chosen option will display as a colored dot with its label.
Status (statusbar): The option list will displayed as the status progress.
Reference¶
Reference: Refers to a field type that allows you to create a reference or link to another record in the system. It allows you to establish relationships between different records within the database.
Binary¶
Binary (the File tile): Refers to a field type that allows you to store binary data, such as images, documents, or any other type of file, within the database (the Image tile creates a binary field shown as a picture). The widgets have supported includes:
File (binary): The files will be displayed as binary files.
Image (image): The files will be displayed as the picture type.
PDF Viewer (pdf_viewer): The files will be displayed on the viewer screen.
Monetary¶
Monetary: Refers to a field type that is used to represent monetary values or amounts in a specific currency. The widgets have supported includes Monetary (monetary), Float (float) and Stat Info (statinfo).
Advanced fields and their widgets¶
Three types of advanced fields can be used on Viindoo Customizer to link a model to other models:
Many2one,
One2many,
Many2many.
So what is the model? Model refers to a class that represents a specific entity or concept in the system. It serves as a blueprint for creating and manipulating records in the database. Each model represents a table in the database and encapsulates the fields, methods, and behavior associated with that entity. Models define the structure of the data, and its relationships with other models, and provide functionalities such as data validation, access control, and business logic.
Many2one¶
The Many2one field refers to a field type that establishes a many-to-one relationship between two models. It allows you to create a link from one model to a single record in another related model. From this field, you can go directly to the record’s details. The widgets supported include:
Many2one (many2one): This is the default widget of Many2one. It will be displayed as a dropdown list and you only choose or create or edit this related record.
Badge (badge), Badges (selection_badge), Radio (radio), Selection (selection), Status (statusbar), Image (image) and Stat Info (statinfo) display the related record in another way.
One2many¶
The One2many filed refers to a field type that establishes a one-to-many relationship between two models. It allows you to create a link from one model to multiple records in another related model.
For example: This field has a one2many relationship with the Contacts model:
Note
To create a one2many field in the specific model, you must create the many2one field in the related model that establishes the reverse relationship. For example, you need to create a Contacts field with one2many type on the new model, so you need to create a new field with many2one type on the Contacts model.
The widgets have supported includes:
Relational table (one2many): This is the default widget of One2many. It will be displayed as a popup window and you only can create or edit this related record.
Relational table (many2many): It will be displayed as a popup window and you can choose the series of records or create a new one.
Tags (many2many_tags): The related records are displayed as tags.
Stat Info (statinfo): The number of related records is displayed as a statistic of a smart button.
Many2many¶
The Many2many field is a common field type used to establish a many-to-many relationship between two models. It allows you to create a relationship where multiple records from one model can be linked to multiple records from another model. The widgets supported include Tags (many2many_tags) and Relational table (many2many).
Views¶
Views are an essential part of the user interface (UI) design and define how data is displayed, organized, and interacted with in the system. Views determine the structure, layout, and appearance of records and their fields in the interface. In Viindoo Customizer, when creating a new model you can be supported with: List view, Form view, Graph view and Pivot view.
List view: It presents records in a tabular format, similar to a spreadsheet or a list. List views are commonly used to display multiple records simultaneously, allowing users to navigate and filter data efficiently.
Form view: It is used to display and edit individual records. Each field of the record is represented by an input widget in the form view. Users can enter or modify data directly in the form view.
Graph view: It presents data in the form of graphical charts or graphs, allowing users to visualize and analyze data trends, comparisons, or distributions.
Pivot view: It offers a summarized view of data through pivot tables. Users can define row and column dimensions and perform calculations on numerical data, providing a flexible way to analyze and summarize information.