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
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 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 | |
to_dict()
Convert the column definition to a dict for JSON serialization.
Source code in ckanext/tables/table.py
311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 | |