TodoListField

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.

Todo list field
//<code-header>
fiddle.title = 'Todo list field';
//</code-header>
const taskBoard = new TaskBoard({
    appendTo : targetElement,

    features : {
        columnToolbars : false,
        taskEdit       : {
            items : {
                todo : {
                    type         : 'todolist',
                    label        : 'Todo',
                    name         : 'todo',
                    textField    : 'title',
                    checkedField : 'done'
                }
            }
        }
    },

    bodyItems : {
        todo : {
            type         : 'todolist',
            textField    : 'title',
            checkedField : 'done'
        }
    },

    // Columns to display
    columns : [
        'todo',
        'doing',
        'done'
    ],

    // Field used to pair a task to a column
    columnField : 'status',

    // Project using inline data
    project : {
        taskStore : {
            fields : [{ name : 'todo', type : 'array' }]
        },

        tasks : [
            {
                id     : 1,
                name   : 'Double click me',
                status : 'doing',
                todo   : [
                    { title : 'Build', done : true },
                    { title : 'Compile', done : true },
                    { title : 'Process', done : false }
                ]
            },
            {
                id     : 2,
                name   : 'Or me',
                status : 'done',
                todo   : [
                    { title : 'Debug', done : true },
                    { title : 'Trace', done : false },
                    { title : 'Profile', done : true }
                ]
            }
        ]
    }
});

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 }
               ]
           }
       ]
   }
});

Configs

110

Common

checkedField: String= checked

Name of a property on a todo item to use for the checkbox. The property is expected to be a boolean.

textField: String= text

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

listenersEvents

Other

editableItems: Boolean= true

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

columnWidget
nameField
rtlRTL
spanWidget
valueField

Accessibility

ariaLabelWidget
keyMapKeyMap

Container

inlineField

CSS

clsWidget
colorWidget
htmlClsWidget
styleWidget
uiWidget

DOM

adoptWidget
appendToWidget
contentWidget
datasetWidget
htmlWidget
idWidget
tagWidget
titleWidget

Float & align

alignWidget
anchorWidget
centeredWidget
draggableWidget
floatingWidget
xWidget
yWidget

Input element

Label

hintField
labelLabelable
labelClsLabelable
labelPositionLabelable
labelsField
labelWidthLabelable

Layout

alignSelfWidget
dockWidget
flexWidget
heightWidget
hiddenWidget
marginWidget
maxHeightWidget
maxWidthWidget
minHeightWidget
minWidthWidget
textAlignWidget
weightWidget
widthWidget

Misc

badgeBadge
dataFieldWidget
disabledWidget
localeClassLocalizable
localizableLocalizable
maskedWidget
ownerWidget
refWidget
rippleWidget
tabWidget
tooltipWidget

Scrolling

Properties

82

Class hierarchy

isTodoListField: Boolean= truereadonly
Identifies an object as an instance of TodoListField class, or subclass thereof.
isTodoListField: Boolean= truereadonlystatic
Identifies an object as an instance of TodoListField class, or subclass thereof.
isBadgeBadge
isDelayableDelayable
isEventsEvents
isFieldField
isKeyMapKeyMap
isLabelableLabelable
isLocalizableLocalizable
isValidatableValidatable
isWidgetWidget

Accessibility

keyMapKeyMap

CSS

clsWidget

DOM

appendToWidget
contentWidget
datasetWidget
elementWidget
htmlWidget
idWidget
styleWidget

Float & align

xWidget
yWidget

Layout

alignSelfWidget
flexWidget
heightWidget
marginWidget
maxHeightWidget
maxWidthWidget
minHeightWidget
minWidthWidget
widthWidget

Lifecycle

configBase

Misc

badgeBadge
cellInfoWidget
disabledWidget
errorTipValidatable
labelLabelable
localeHelperLocalizable
localeManagerLocalizable
refWidget
tabWidget
tooltipWidget

Other

$namestaticWidget
columnWidget
inputField
isEmptyField
isValidField
rtlRTL
spanWidget
typestaticWidget
valueField

Visibility

hiddenWidget
isVisibleWidget

Widget hierarchy

ownerWidget
parentWidget

Functions

64

Configuration

applyDefaultsstaticBase

Events

Float & align

alignToWidget
setXYWidget
showByWidget
toFrontWidget

Lifecycle

createstaticWidget
destroystaticBase
initClassstaticWidget

Misc

attachTooltipstaticWidget
fromElementstaticWidget
fromSelectorstaticWidget
getByIdstaticWidget
isOfTypeNamestaticBase
mixinstaticBase
optionalLstaticLocalizable

Other

clearField
clearErrorValidatable
composeWidget
createOnFrameDelayable
disableWidget
enableWidget
focusWidget
getErrorsValidatable
LstaticLocalizable
maskWidget
onEvents
recomposeWidget
relayAllEvents
selectField
setErrorValidatable
triggerEvents
unEvents
unmaskWidget

Visibility

hideWidget
showWidget

Widget hierarchy

closestWidget
containsWidget
ownsWidget
queryWidget
queryAllWidget
upWidget

Events

19
actionField
catchAllEvents
changeField
clearField
destroyEvents
focusInWidget
focusOutWidget
hideWidget
inputField
paintWidget
readOnlyWidget
recomposeWidget
resizeWidget
showWidget
triggerField

Event handlers

19

Typedefs

7

CSS variables

39