CRUD Gadget
Available from version 3.3.0 (moonwalker)
Description
This functionality allows you to create gadgets that offer the CRUD functionality (Create, Read, Update and Delete) on an Entity without having to program anything. The functionality allows you to create, edit, delete and search for items, in addition to exporting the list to CSV.
This gadget has been built as a Gadget Template (on Vue and lib Elements) and serves as a user interface to facilitate the view, search and modification of the information of the platform entities from a dashboard.
Available template settings
It has three types of view pre-configured depending on the value assigned to the typeGadget parameter.
These views are designed for the type of use they are intended for:
typeGadget: 'withWizard' It will show the complete wizard as in the image above to be able to perform searches in the entity by defining clauses for the where, order by a maximum of values and an offset. This type is more intended for use by a role type administrator, who has technical knowledge to know what a where is, etc.
typeGadget: ‘searchOnly’ It will partially show the wizard to be able to search in the entity, defining only clauses for the where. This type is more intended to be used by a user, role which needs to specify filters in the data queries.
Â
typeGadget: ‘noWizard’ with this option, the wizard is not displayed. In this case the template is intended for use by an end user, providing them with a simple tool to be able to manipulate and query data from their entities.
hideIdColumn: It is also possible to indicate, in the template parameters, if you prefer to show the column with the ids or without them.
hideIdColumn: false, // show or hide id column
Â
Template elements
Entity selector, on which the CRUD operations will be performed.
Switch that shows or hides the wizard.
Wizard to perform queries on the entity's records.
Form to add elements to the where in the query.
Â
Form to add items to the query’s ordering.
Searcher for table records.
Button that allows you to download the records in csv or json format. It gives the option of downloading all the records of the entity or only the selected ones if a previous search has been made from the wizard.
Download example in csv.
Download example in json.
Button to hide or show table columns.
Button to create new records.
Â
Each record in the table has three buttons, the first one to display the information of the record in a form,
the second one to edit said record,
and the third one to delete the record permanently.
The table has pagination to make it easier to use,
being able to select the total number of records to be displayed per page.
Internacionalization
The template is internationalized with the i18n standard implemented in the platform. There is a record under Manage Internationalizations where the internationalization is in English and Spanish. This applies to the elements of the template such as buttons, selectors, ... and to the headers of the columns and forms.
Entity by parameter
The gadget allows defining a parameter by URL to take it as the initial entity. With this, we manage that another entity cannot be selected from the moment the dashboard is accessed.
How to add it to your dashboards?
First of all, create a dashboard using the initial configuration and the internationalization that is provided from this version of the platform for these gadgets.
Â
In the dashboard editing screen, press the icon:
And drag the Custom gadget element on your dashboard:
Select the type of gadget we want to add:
Click on New Gadget:
Assign an identifier and a description to the custom gadget to be able to locate it and use it on other occasions.
Being parameterized in this screen, you can select the options explained above, as if you want it to only access an entity, the type of wizard to show or show or not the column of ids.
After pressing OK, the gadget will appear on the dashboard.
Once created, to reuse it, you just have to select the type and the newly created instance of the custom gadget and press ADD GADGET.
Â