v7.3.0

TodoListField
Widget

A field that displays, and also lets users edit, a list of todo items. Each item has a checkbox to mark if the item is completed or not and a button to edit its text/remove it. Designed to be used in the task editor, to work in tandem with the TodoListItem.

To hook it up, add it to the task editors items and link it to a field on your task model declared with type : 'array'. The fields data is expected to be an array of objects. Configure textField and checkedField to match the names used by the objects in your array.

This snippet illustrates basic usage:

const taskBoard = new TaskBoard({
   features : {
       taskEdit : {
           items : {
               todo : {
                   type         : 'todolist',
                   label        : 'Todo',
                   field        : 'todo',
                   // "title" property will be used as the todo item text
                   textField    : 'title',
                   // "done" property will drive the checkbox
                   checkedField : 'done'
               }
           }
       }
   },

project : { taskStore : { fields : [ { name : 'todo', type : 'array' } ] }

tasks : [ { id : 1, name : 'Important task', todo : [ { title : 'Fix this', done : true }, { title : 'Fix that', done : false } ] } ] } });
No results

Configs

Configs are options you supply in a configuration object when creating an instance of this class
  • Name of a property on a todo item to use for the checkbox. The property is expected to be a boolean.

  • Name of a property on a todo item to display as its text.

  • Configure as false to hide the per item edit button and the add item button. Users can still check/uncheck items.

Properties

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

CSS variables

CSS variables that can be set to adjust appearance
Name Description
--b-task-board-todo-list-field-background List background
--b-task-board-todo-list-field-color List item color
type: todolistfield

Source path

TaskBoard/widget/TodoListField.js

Contents