Table Layout



The TableLayoutWdg is the primary widget used to layout tabular data. It is primarily driven by the widget configuration. The TableLayoutWdg has the ability to display complex widgets inside each cell, to inline edit the data and to color code cells. It is the widget that is most often used to display information within the TACTIC.



Table Layout



TACTIC Version Support

2.5.0 \+

Required database columns



The TableLayoutWdg makes use of "views" which are defined in the widget config for each project. When the Table is loaded as part of an interface, a view configuration is passed into it which defines which columns and widgets should be displayed in the view. Typically, these view configurations are automatically saved in the background when a user saves a view from within the TACTIC interface. The table itself provides the ability to add, remove, rearrange, resize and group columns which can then be saved out often as links in the sidebar.

The following shows a simplified version for an "asset tracking" view as saved in the background widget config.

  <asset_tracking layout="TableLayoutWdg" >
    <element name="preview" width="74px"/>
    <element name="asset_category_code" width="64px"/>
    <element name="code" width="61px"/>
    <element name="title" width="121.883px"/>
    <element name="description" width="276.75px"/>
    <element name="keywords" width="253.367px"/>
    <element name="general_checkin" width="27px"/>
    <element name="history" width="42px"/>
    <element name="task_edit" width="29px"/>
    <element name="task_status_edit" width="223.167px"/>

The widget configuration is an XML document. In this example, it defines an "asset_tracking" view with elements (preview, asset_category, code, title, description, keywords, etc…​).

To draw what to display, TableLayoutWdg looks at the list of elements defined in the widget config and draws a column for each element. TACTIC then draws a row for each item that was either retrieved from a search, an expression or by supplied items. Each cell in the table represents an item being drawn by the defined element for a given column.

While the top widget configuration defines the list of elements to draw the columns, the exact definition of each element do not necessarily appear here. There are a number of views which define an element. Some of these elements may be defined inline or they may be defined elsewhere. There is a set hierarchy which the TableLayoutWdg looks for to find the definition of a particular element.

The hierarchy which TableLayoutWdg looks to find the definition for an element is as follows:

  1. the given type, view combination in the widget_config table

  2. the "definition" view for the given type in the widget_config table

  3. the predefined views for a given type (modules shipped with TACTIC will have predefined views for may of the items to ensure proper functioning of TACTIC even if there are no entries in the widget_config database)

  4. the "default_definition" for a given sType as defined in the predefined views.

The third and fourth locations only apply to predefined sTypes that are shipped with TACTIC. All custom types will only use the first two.



Define the sType that this table will be displaying. It is used both for finding the appropriate widget config and for handling search (if necessary). Defaults to "table".


Defines the view that this table will displaying. It used to find the appropriate widget config to display the table.


Specify the path to a custom insert view.


Specify the path to a custom edit view.


Specify a custom layout view that Ingest Files menu option opens in a new tab.


Specify a view similar to edit view that defines any data to be saved with each ingested sobject.


Specify an expression to drive the search. The expression must return items. e.g. @SEARCH(sthpw/note) or @SOBJECT(sthpw/note)


Explicitly define the widget config. the kwarg view is preferred over this.


By default, the TableLayoutWdg will handle the search itself. However, certain widgets may wish to turn this functionality off because they are supplying the search (internally used by ViewPanelWdg) - true, false.


Add an explicit order by in the search


Set a specific parent for the search


Override the checkin context for Check-in New File - publish (default).


Override the checkin type for Check-in New File - auto, strict.


Define an initial overall width for the table


Determine whether to show the gear menu - true, false.


Determine whether to show the search box - true, false.


Determine whether to show the search limit - true, false.


Determine whether to show the insert button - true, false.


Display the refresh button on the shelf - true, false.


Determine whether to show the Keyword search input - true, false.


Determine whether to show row_selection - true, false.


Determine whether to show the action shelf - true, false.


Determine whether to show the layout switcher - true, false.


Determine whether to show the column manager - true, false.


Determine whether to show the collection button - true, false.


Determine whether to show the context menu - true, false.


Determine whether to show the expand button - true, false.


Determine whether to show the help button - true, false.


Determine whether to show the table border - true, false.


Determine whether to show the table header - true, false.


Determine whether to show the insert button - true, false.


The number of items to show on each page. e.g. 20 A value < 0 means no limit affecting the search.


Determine if it displays top, bottom or both search limit - bottom, top, both


Determine whether to draw with widgets or just use the raw data - widget, raw.


Explicitly set the element names to be drawn


Very often, the TableLayoutWdg is not used directly, but is used through the ViewPanelWdg, which combines the TableLayoutWdg with the SearchWdg. Using ViewPanelWdg will provide all the functionality in a table view

Using the TableLayoutWdg does provide a simpler view if the search is already known,

This simple example shows the login table and the objects are explicitly given.

from tactic.ui.panel import TableLayoutWdg
div = DivWdg()
table = TableLayoutWdg(search_type='sthpw/login', view='table')
sObjects = Search("sthpw/login").get_sObject()

An expression can be set for the search as well.

from tactic.ui.panel import TableLayoutWdg
div = DivWdg()
expression = "@SOBJECT(sthpw/login)"
table = TableLayoutWdg(search_type='sthpw/login', view='table',expression=expression)

This example embeds the login table with a "table" view in a CustomLayoutWdg.

    <h1>This is the login table</h1>
    <element name='login_table'/>
  <element name='login_table'>
    <display class='tactic.ui.panel.TableLayoutWdg'>

The widget config views determine how the TableLayoutWdg draws itself. There are a few custom attributes that a view can define. The view can define many parts of how the TableLayoutWdg is displayed. The following hides the "insert" button and makes each of the cells non-editable. These attributes are useful for reports which are generally not editable.

<?xml version="1.0" encoding="UTF-8"?>
  <simple insert='false' edit='false'>
    <element name="preview"/>
    <element name="code"/>
    <element name="name"/>
    <element name="description"/>