Axelor Doc

The views lists

A list view is defined by the tag <grid>.

The syntax is as follows:

<grid
    title="gridTitle"
    name="gridName"
    model="gridModel"
    editable="true|false"
    orderBy="sequence_fields"
>
    <toolbar ... [0..1]/>
    <field ... [1..*] />
</grid>
  1. title : The title of the list. This name will be displayed in the tab.
  2. name : The technical name for the view. This name calling and open the correct order from the menu or action.
  3. model : The model used.
  4. editable : Optional. False by default. Sets whether the grid is editable (changing elements directly into the grid)
  5. orderBy : Optional. Field List of the object separated by commas course. Allows you to organize the records.
  6. toolbar : Optional. To redefine and customize the toolbar.
  7. field : The fields to be displayed in the list view.
<grid title="Orders" name="order-grid" orderby="orderDate">
    <field name="name"/>
    <field name="customer"/>
    <field name="orderDate"/>
    <field name="totalAmount"/>
    <field name="confirmed"/>
</grid>

The list view is displayed as follows: list view

The fields of vision are aligned to the left, except for integers and decimals are right aligned and Boolean that are displayed in the center.

You can view more information on this type of view. For example, display items that do not belong to the current model. This can be done by pointing the elements: (Syntax JPA)

<field name="customer.firstName"/>

firstName is a field of the object customer .

In addition, collections can beings in a My View lists. The registration number will be displayed:

list view

Here, D'Address List is a M2M the object. The first contact has one address, the second two addresses ....