Ga naar hoofdinhoud

CnChecklistWidget

The checklist a record carries, ticked in place on its detail page. It is the checklist widget.

  • The items are read off the record in view: content.path, checklist by default. Each item is { id, label, description, checked } unless content names other fields.
  • A tick is written through the detail page's record source (cnRecordChecklist). CnDetailPage provides it when its source can check items, as the tasks source does through the task engine.
  • The box follows the record the write answers with, so a refused tick leaves the item as it was.
  • Without a source that can write, or on a record the source says can no longer be ticked, the list is read-only.
  • An item without an id is left out: the write addresses an item by its id, and a box that cannot be saved would look saved.

Usage​

{
"id": "task-checklist",
"type": "checklist",
"title": "Checklist",
"content": { "path": "checklist", "emptyText": "This task has no checklist." }
}

Content​

KeyDefaultDescription
pathchecklistWhere the items sit on the record
idFieldidAn item's id
labelFieldlabelAn item's label
descriptionFielddescriptionA line under the label
checkedFieldcheckedWhether the item is ticked
emptyTextShown when the record carries no items, through the app's translate
summaryInHeaderfalsetrue: "2 of 4 done" is the line under the card title instead of a line above the items (DqTaak "Checklist")

Props​

PropTypeDefaultDescription
contentObject{}The configuration above
objectDataObjectnullThe record in view, as the detail page hands it to a widget

What it reads​

InjectionDescription
cnRecordChecklistThe record source's checklist writer, provided by CnDetailPage
cnObjectContextThe detail page's record context
cnTranslateThe app's translate