Skip to content

Column

Optional XML element that defines a column and its UI options.

XML
<itm model="column" type="timg" name="logo">/api/files/26EFEED6-CDEF-E911-80DA-9C8E994DC647.png</itm>

In the UI, timg is rendered as an <img> tag.

Attributes

Required

  • name, required

Optional

  • lg - (true/false) show/hide column on desktop
  • sm - (true/false) show/hide column on mobile
  • ex - (true/false) show/hide column on export (for example: Excel)
  • title - title template, for example title="{invoiceFullNR} {printoutName}"
  • text - URL/template, for example /item/{anycolumnname}/{anycolumnname}?app_name=[[app_name]]&amp;columnx1={columnx1}
    • server-side variables [[variable]] are available, see server side variables
    • IMPORTANT: server-side variables are replaced with an empty string if not found
    • Warning: & must be written as &amp; in XML attributes
  • label - label template
    • server-side variables [[variable]] are available, see server side variables
    • IMPORTANT: server-side variables are replaced with an empty string if not found
  • required true/false
  • type see section Column type
  • acl column permission
  • css custom class (see xd.css https://kotynia.github.io/xd-css/)
  • width column width
  • opts
    • uiinline - render inline component in row
    • uianonymize - when the uianonymize role is assigned, sensitive information is removed
    • uisum - total in table footer
    • global-on - information: column configuration was inherited from global configuration global.xml
    • lg-auto - set lg=false when the column value is empty
    • lg-true, lg-false - override desktop visibility; can be set through Business logic in srssetup
    • sm-true, sm-false - override mobile visibility; can be set through Business logic in srssetup
    • dttranslation - translate values if srstranslation data exists

Column type

Autodiscover

List of autodiscover types from database schema

  • tguid
  • tdate - date. On the client, the UTC offset is applied to convert it to local time
  • tbool - Boolean
  • tinteger - Integer, example 2
  • tdecimal - Decimal, example 2.02
  • tstring

UI types

  • tdatetime - date with time DD/MM/YYYY HH:mm. On the client, the UTC offset is applied to convert it to local time
  • tinput_number - input number
  • tinput_text - text
  • tinput_bool - checkbox
  • tlink - link
    • text value = URL
    • if the value is panull, render plain text (no link)
  • tlink_frame - link; Ctrl+click opens a modal
    • text value = URL
    • if the value is panull, render plain text (no link)
  • tlink_modal - tlink_frame with default modal
  • tlink_tag - build tag link with color based on text
  • tlink_icon - internal link with a Font Awesome 4 icon
  • tlink_download - dedicated for files download
  • tlink_icon_download_pdf - dedicated for downloading PDF files
    • the downloaded file name can be set by column.title
    • only works for icons; make sure you pass an icon class in column.css
    • example: <itm model="column" name="action" label="Drukuj" type="tlink_icon_download_pdf" title="{invoiceFullNR} {printoutName}" css="fa fa-print">{action}</itm>
  • tlink_post - send a JavaScript object to a URL
  • turl_blank - external link in new window
  • tcolor_progress
  • turl_progress
  • tformat_bytes - Human readable size input bytes
  • tformat_k - human readable size for large numbers, returns e.g. 10K, 20M
  • ttag - build tag list with color based on text
  • ttagmenu - build tag list with color based on text + extra menu on top
  • tstring_multi - multiline text with line breaks similar to HTML pre tag
  • tstring_2lines - 2 lines of text
  • timg - image
  • tmail - email addresses separated by spaces

server side transformation

  • tcolor, render hexadecimal color code based on text
  • tbase64 - server-side base64 datastore image renderer (returns bytes)
    • supported: "jpg", "png", "jpeg", "apng", "webp", "gif" with optimization; optional w,h,o (width, height, option); default w=400
    • example item 00000000-0000-0000-0000-000000000000.png?w=400
  • tbarcode - server-side barcode (returns bytes); can use width and opts="label" to display a label
  • tqrcode - server-side QR code (returns bytes)
  • tmarkdown - renders markdown to HTML
  • tjson - renders XML to JSON
    • properties starting with <Array will convert to an array
    • properties mentioned in value (csv) will convert to an array, for example <itm model="column" type="tjson" name="xml">xmlField</itm>

Special column names

  • pa_background Hexadecimal color for background
  • pa_color Hexadecimal color for text

Examples

tlink tlink_modal tlink_frame,tlink_post

All link types require a URL as the element value (text/CDATA). In the URL you can use:

  • row data, for example {planid}
  • server-side variables [[variable]] are available, see server side variables
  • client-side parameters are available as {parameter}, which will be replaced with (in order of priority):
    1. client side parameters passed to the srs
    2. query string parameters
  • Warning: & must be written as &amp; in XML attributes (or use CDATA)
XML
<itm model="column" type="tlink_modal" css="xd-button" name="PlanDetails" label="-"><![CDATA[/srs/456-plan/view?planid={planid}&app_name=[[app_name]]]]></itm>
<itm model="column" type="tlink_modal" css="xd-button" name="PlanDetails" label="-"><![CDATA[/srs/456-plan/view?planid={planid}&datefrom=[[datefrom]]]]></itm>

tjson - Arrays Examples

By default, if a single element is provided it will be returned as an object. In some cases you may want to force an array, for example when you want the output to always be an array (even if it has a single item).

XML
1
2
3
<xml>
 <file>test</file>
</xml>

Output

JSON
1
2
3
4
5
{
  "xml": {
    "file": "test"
  }
}

There are 2 options to force an element to be an array.

  1. force array output for a single item by starting the element name with <Array (otherwise it will return an object)
  2. properties mentioned in the value (csv) will convert to an array, for example <itm model="column" type="tjson" name="xml">xmlField,xmlField2</itm>

Example 1 - force array output <Array

XML
1
2
3
4
5
6
7
8
<ArrayOfFile>
  <file>
    <name>image001.png</name>
    <bytes>32674</bytes>
    <hash>550dc3bf-a1d2-e39b-58b1-56883453c2f0</hash>
    <extension>.png</extension>
  </file>
</ArrayOfFile>
JSON
{
  "ArrayOfFile": {
    "file": [
      {
        "name": "image001.png",
        "bytes": "32674",
        "hash": "550dc3bf-a1d2-e39b-58b1-56883453c2f0",
        "extension": ".png"
      }
    ]
  }
}

Example 2 - force array output for specific elements <itm model="column" type="tjson" name="xml">file</itm>

XML
1
2
3
<xml>
 <file>test</file>
</xml>
JSON
1
2
3
4
5
6
7
{
  "xml": {
    "file": [
      "test"
    ]
  }
}

Example 3 - self closing tag

XML
1
2
3
4
5
<diff>
  <itm name="ID" old="a" new="b" />
  <itm name="DATE" old="" new="2025-03-11 00:00:00" />
  <itm name="LINEID" old="" new="b2401d60-ce9c-ef11-95b7-d89d6719e0cb" />
</diff>

OUT

JSON
{
  "diff": {
    "itm": [
      {
        "@name": "ID",
        "@old": "a",
        "@new": "b"
      },
      {
        "@name": "DATE",
        "@old": "",
        "@new": "2025-03-11 00:00:00"
      },
      {
        "@name": "LINEID",
        "@old": "",
        "@new": "b2401d60-ce9c-ef11-95b7-d89d6719e0cb"
      }
    ]
  }
}

timg images

Important: ampersand (&) must be written as &amp; in attributes, or you can use a CDATA section.

XML
1
2
3
4
5
6
7
8
9
<itm model="column" type="timg" name="logo">/api/files/26EFEED6-CDEF-E911-80DA-9C8E994DC647.png</itm>
<itm model="column" type="timg" name="logo">/assets/images/logo.png?w=150</itm>
<itm model="column" type="timg" name="mail_to_avatar">/account/avatar/{mail_to_avatar}</itm>
<!--Example BARCODE-->
<itm model="column" type="timg" name="qr" width="100">/api/core/system/barcode?code={qr}&amp;type=code128</itm>
<!--Example BARCODE using cdata -->
<itm model="column" type="timg" name="qr" width="100"><![CDATA[/api/core/system/barcode?code={qr}&type=code128]]></itm>
<!--Example QRCODE-->
<itm model="column" type="timg" name="qr" width="100">/api/core/system/qrcode?code={qr}</itm>

turl_blank external linking

XML
1
2
3
4
<!--Redirect to external page-->
<itm model="column" type="turl_blank" name="test1">http://test.com/test?commissionID={commissionID}</itm>
<itm model="column" type="turl_blank" name="email">mailto:{email}</itm>
<itm model="column" type="turl_blank" name="phone">tel:{phone}</itm>

tstring_multi Text with Line breaks similar to HTML pre tag

SQL Server Example:

SQL
SELECT 'Hello' + CHAR(13) + CHAR(10) + 'World'

pa_background color for background

Used with 'var(--xd-green1)'

XML
1
2
3
4
5
6
7
8
9
<itm model="command" name="saleInvoiceDateSummary"><![CDATA[
select
  ROUND(sum(sysnetValue), 2) value,
  'RAZEM'  invoiceCategory,
  'var(--xd-green1)' pa_background
FROM
  saleInvoiceSummary 
]]>
</itm>

Used with hex value (e.g. '#112233') or column name from query (e.g.column_hex_example)

XML
1
2
3
4
5
6
7
8
9
<itm model="command" name="saleInvoiceDateSummary"><![CDATA[
select
  ROUND(sum(sysnetValue), 2) value,
  'RAZEM'  invoiceCategory,
  '#112233' pa_background 
FROM
  saleInvoiceSummary 
]]>
</itm>