v7.3.0

ColumnModel

Represents a single column on a TaskBoard.

When creating a TaskBoard, you can either supply an initial set of columns or have the columns be loaded remotely as part of the Project data. These columns are either defined as plain strings, ColumnModel data objects or ColumnModel records (or a mix thereof). When using strings, the string will be used as is as the column's id and capitalized as its text.

const doneColumn = new ColumnModel({
    id   : 'done',
    text : 'Done'
});

const taskBoard = new TaskBoard({ columns : [ // String, equal to passing { id : 'todo', text : 'Todo' } 'todo', // Data object, in this case with a fixed width and not collapsible from the UI { id : 'doing', text : 'Doing', width : 200, collapsible : false } // Record, not commonly used since it is easier to supply the data object directly doneColumn ] });

Loading Columns remotely

const taskBoard = new TaskBoard({
    // Project will load columns, tasks, resources and assignments
    project : {
        loadUrl  : 'data/data.json',
        autoLoad : true
    }
});

data.json

{
  "success" : true,
  "columns" : {
    "rows" : [
      {
        "id"   : "todo",
        "text" : "Todo"
      },
      {
        "id"          : "doing",
        "text"        : "Doing",
        "tasksPerRow" : 2
      },
      {
        "id"          : "review",
        "text"        : "Review",
        "tasksPerRow" : 2
      },
      {
        "id"          : "done",
        "text"        : "Done",
        "tasksPerRow" : 2
      }
    ]
  }
}

You can see this in action in the columns-remote demo in the examples folder.

No results

Fields

Fields belong to a Model class and define the Model data structure
  • Allow collapsing this column

  • If 'true', a filter icon is displayed in the column header, allowing the user to do complex filter operations on the column's tasks. Requires the ColumnFilter feature to be enabled.

  • Column flex, affects width.

  • Set to true to hide the column, false to show it again.

  • By default, the header text is HTML-encoded. Set this flag to false to disable this and allow html elements in the column header

  • This column's unique id, used to match a task to a column (which field on a task to match is specified using then columnField config on TaskBoard).

  • locked : 'start'/'end'/null

    Set to 'start' or 'end' to lock the column on the inline start or end side (left or right for LTR, vice versa for RTL) of other columns, otherwise set to null to do not lock the column.

  • Column min-width in px. To override the default min-width specified in CSS.

  • If 'true', a search field is displayed in the column header, allowing the user to quick filter the column's tasks. Requires the FilterBar feature to be enabled.

  • If 'true', a sort icon is displayed in the column header, allowing the user to sort the tasks. Requires the ColumnSort feature to be enabled.

  • Number of tasks per row to display in this column. Leave blank to use the setting from the tasksPerRow config on TaskBoard.

  • Text displayed in the column header.

  • A tooltip string to show when hovering the column header

  • Column width in px.

Properties

Properties are getters/setters or publicly accessible variables on this class

Functions

Functions are methods available for calling on the class

    Source path

    TaskBoard/model/ColumnModel.js

    Contents