Column
Optional XML element that defines a column and its UI options.
| XML | |
|---|---|
In the UI, timg is rendered as an <img> tag.
Attributes
Required
name- column name
Optional
lg- (true/false) show/hide column on desktopsm- (true/false) show/hide column on mobileex- (true/false) show/hide column on export (.html,.xlsx,.md,.txt,.xml); default islgtitle- title template, for exampletitle="{invoiceFullNR} {printoutName}"- element value (text or CDATA) - URL/template, for example
/item/{anycolumnname}/{anycolumnname}?app_name=[[app_name]]&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&(or use CDATA)
- server-side variables
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
- server-side variables
typesee sectionColumn typeacl- column permission; without the permission the column is hidden and its values are removedcss- custom CSS class (see xd.css https://kotynia.github.io/xd-css/)width- column widthoptsuiinline- renders thev_component inline in the row instead of opening it in a modaluianonymize- when theuianonymizerole is assigned, sensitive information is removeduiauto-width- if the total width of the columns is below 1320, the column fills the empty spaceuisum- show the total in the table footerglobal-on- information: column configuration was inherited from global configurationglobal.xmllg-auto- setlg=falsewhen the column value is emptylg-true,lg-false- override desktop visibility; can be set through Business logic insrssetupsm-true,sm-false- override mobile visibility; can be set through Business logic insrssetupdttranslation- translate values ifsrstranslationdata existsuirownav- thev_column opens by default from the row menu (dots) instead of the generic property list
Column type
Autodiscover
List of autodiscover types from the database schema:
tguidtdate- date. On the client, the UTC offset is applied to convert it to local timetbool- Booleantinteger- Integer, example 2tdecimal- Decimal, example 2.02tstring
UI types
UI types apply only to the default client UI. Renderers such as .json or .xlsx ignore them.
tdatetime- date with timeDD/MM/YYYY HH:mm. On the client, the UTC offset is applied to convert it to local timetinput_number- input numbertinput_text- texttinput_bool- checkboxtinput_date- date inputtlink- 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_frame_blank-tlink_framethat opens in a new browser tabtlink_modal-tlink_framewith a default modaltlink_tag- renders a tag link with a color based on the texttlink_icon- internal link with a Font Awesome 4 icon- text value = URL
- column.css - Font Awesome 4 class https://fontawesome.com/v4.7.0/icons/, example
fa fa-bar-chart
tlink_download- dedicated to downloading filestlink_icon_download_pdf- dedicated to 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>
- the downloaded file name can be set by
tlink_post- on click, sends a POST with the row as an object (plus the query string parameters of the URL) and reloads the tableturl_blank- external link in a new windowtcolor_progressturl_progresstformat_bytes- human-readable size from input in bytestformat_k- human-readable format for large numbers, returns e.g.10K,20Mttag- renders a tag list with colors based on the textttagmenu- renders a tag list with colors based on the text, with an extra menu on toptstring_2lines- two lines of texttimg- imagetmail- email addresses separated by spacestdonut,tchart- small donut chart for a percentage valuetnotes- flag icon with the note textv_...- custom Vue component, for examplev_form_auto; see Custom component column
Server-side transformation
Server-side transformations are executed on the server after the data is processed.
You cannot use the result of a server-side transformation in a query or virtual query (link="self").
- file related
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); defaultw=400 - example item
00000000-0000-0000-0000-000000000000.png?w=400
- supported: "jpg", "png", "jpeg", "apng", "webp", "gif" with optimization; optional
tfs_exist- server-side file existence check (T/F)tfs_length- server-side file length (KB)tfs_videolength- server-side video length (seconds), Windows X64 only, experimental
tcolor- renders a hexadecimal color code based on the texttbarcode- server-side barcode (returns bytes)widthset widthopts="label"show label- tips: to scale height and avoid image loss
<div style="height: 50;overflow: hidden;"><img src="data:image/png;base64,{{barcode}}" /></div>
tqrcode- server-side QR code (returns bytes)tmarkdown- renders Markdown to HTMLtjson- renders XML to JSON- properties starting with
<Arraywill 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>
- properties starting with
txml- XML fragment for the.xmlrenderer- the value is inserted as-is, without an element named after the column
- use it for repeated child elements, for example a
FOR XML PATH('INV_ITEM'), TYPEsubquery - a value that is not valid XML is written as escaped text
- see XML export
Special column names
pa_background- hexadecimal color for the backgroundpa_color- hexadecimal color for the text; when empty, a readable text color is calculated frompa_background
The UI also accepts CSS variables such as var(--xd-green1). The .html and .xlsx renderers use only hexadecimal values starting with #.
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):- client side parameters passed to the srs
- query string parameters
- Warning:
&must be written as&in XML attributes (or use CDATA)
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).
Output
There are two options to force an element to be an array.
- force array output for a single item by starting the element name with
<Array(otherwise it will return an object) - 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 | |
|---|---|
| JSON | |
|---|---|
Example 2 - force array output for specific elements <itm model="column" type="tjson" name="xml">file</itm>
Example 3 - self closing tag
| XML | |
|---|---|
Output
| JSON | |
|---|---|
timg images
Important: ampersand (
&) must be written as&in attributes, or you can use a CDATA section.
turl_blank external linking
| XML | |
|---|---|
pa_background color for background
Used with a CSS variable, for example
var(--xd-green1)
| XML | |
|---|---|
Used with a hex value (for example
'#112233') or a column name from the query (for examplecolumn_hex_example)
| XML | |
|---|---|
Custom component column
Example:
A column with a type that starts with v_ renders a Vue component, for example v_form_auto.
- by default, the cell shows the column value as a button; a click opens the component in a modal
- with
opts="uiinline", the component is rendered directly in the cell - with
opts="uirownav", the component also opens from the row menu (dots) - an empty cell value renders nothing (without
uiinline) - the element value is a JSON object with component props
{columnName}placeholders are replaced with the row values- the object is passed to the component as the
paramsprop
- the component also receives
row,column,value(cell value),table,parameters(SRSdef) andclipboard_items; areload-eventemitted by the component reloads the table
| XML | |
|---|---|
A click on the location code opens the srs/993/api form for the location in the row:
