Using iTop

Creating your iTop

iTop Customization

"How to" examples

User Interface

Automation & Ticket management

Portal Customization

:: Version 3.2.0 ::

Order enumeration values

Prerequisite: You must be familiar with the Syntax used in Tutorials and have already created an extension.

Specify in which order the values of a Attribute Enum should be displayed
min version:

The iTop 3.1 brings new capabilities to order the values of a enumeration attribute.

Before 3.1 version, values of an enumeration were ordered alphabetically by code

Now, you can specify in the XML tag sort_type, which ordering method you want amongst

  • code: default value, same behavior as before 3.1
  • label: values are displayed by alphabetical order of labels (this means that the order can be different depending on the user language)
  • rank: this suppose that you specify a rank on each value
    • Values with rank are displayed first, followed by those without rank, using the code alphabetical order.
    • rank is a new XML tag under values/value in parallel of the code and the style

Order by label

itop_design / classes / class@Incident / fields
        <field id="origin" xsi:type="AttributeEnum">
            <value id="in_person"><code>in_person</ code></value>
            <value id="chat"><code>chat</ code></value>
            <value id="mail"><code>mail</ code></value>
            <value id="phone"><code>phone</ code></value>
            <value id="portal"><code>portal</ code></value>
            <value id="monitoring"><code>monitoring</ code></value>

Order by rank

itop_design / classes / class@UserRequest / fields
       <field id="status" xsi:type="AttributeEnum">
            <value id="new">
              <code>new</ code>
            <value id="waiting_for_approval">
              <code>waiting_for_approval</ code>
                <decoration_classes>fas fa-hourglass-half</decoration_classes>
            <value id="approved">
              <code>approved</ code>
                <decoration_classes>fas fa-user-check</decoration_classes>
3_2_0/customization/order-enum.txt ยท Last modified: 2024/06/20 17:28 (external edit)
Back to top
Contact us