Column Definition
The column definition holds the configuration for a table column, including its field name, data type, formatters, and other options.
Below you can check the available attributes of the ColumnDefinition class and their descriptions. Also, a full code is provided at the end of this document for reference.
Column definition.
| ATTRIBUTE | DESCRIPTION |
|---|---|
field |
The field name in the data dictionary.
TYPE:
|
title |
The display title for the column. Defaults to a formatted version of
TYPE:
|
formatters |
List of custom server-side formatters to apply to the column's value.
TYPE:
|
tabulator_formatter |
The name of a built-in Tabulator.js formatter (e.g., "plaintext").
TYPE:
|
tabulator_formatter_params |
Parameters for the built-in tabulator formatter.
TYPE:
|
width |
The width of the column in pixels.
TYPE:
|
min_width |
The minimum width of the column in pixels.
TYPE:
|
visible |
Whether the column is visible.
TYPE:
|
sorter |
The default sorter for the column (e.g., "string", "number").
TYPE:
|
filterable |
Whether the column can be filtered by the user.
TYPE:
|
resizable |
Whether the column is resizable by the user.
TYPE:
|
tooltip |
Whether to show a tooltip with the full content on hover.
TYPE:
|
vertical_align |
Vertical alignment of the column content. Defaults to "middle".
TYPE:
|
horizontal_align |
Horizontal alignment of the column content. Defaults to "".
TYPE:
|
Source code in ckanext/tables/table.py
195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 | |
to_dict()
Convert the column definition to a dict for JSON serialization.
Source code in ckanext/tables/table.py
235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 | |