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
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 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 | |
to_dict()
Convert the column definition to a dict for JSON serialization.
Source code in ckanext/tables/table.py
275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 | |