Kanban View

The kanban view is a agile dashboard like view.

<kanban name="project-task-kanban" title="Project Tasks" model="com.axelor.project.db.ProjectTask"
  columnBy="state" sequenceBy="priority" onNew="project.task.kanban.on.new" limit="10">
  <field name="name"/>
  <field name="notes" />
  <field name="progress"/>
  <field name="startDate"/>
  <field name="endDate"/>
  <field name="user"/>
  <hilite color="danger" if="progress == 0" />
  <hilite color="success" if="progress == 100" />
  <hilite color="info" if="progress &gt;= 50" />
  <hilite color="warning" if="progress &gt; 0" />
  <template><![CDATA[
    <>
      <Box as="strong">
          {name}
      </Box>
      <Box d="flex" mt={2}>
          {notes}
      </Box>
      <Box d="grid" gridTemplateColumns="auto auto" style={{ fontSize: "0.85rem", color: "grey" }} mt={2}>
          <Box d="flex" g={2}>
            <Icon icon={"clock"} />
            {startDate && <span>{$moment(startDate).format('LLL')}</span>}
          </Box>
          <Box d="flex" justifyContent="flex-end">
            {user && <Image src={$image('user', 'image')} style={{ width: "1.5rem", height: "1.5rem", borderRadius: "100%" }}/>}
          </Box>
      </Box>
    </>
  ]]></template>
</kanban>

The kanban view attributes are:

Attribute

Description

name

name of the view

model

fully qualified name of the domain model

columnBy

a field to create columns. Can be an enum, selection or a reference field.

sequenceBy

a field to use to re-order the cards (numeric fields only)

onNew

a field to use when creating record on the fly

onMove

action to call when moving a kanban card

onDelete

action to call when deleting a card

limit

pagination limit per column

x-collapse-columns

comma-separated list of column names that should be collapsed by default (reference fields not supported)

Template

The <template> should be used to provide template to prepare the context of cards. It can use only the defined <field> values.

A template helper function $image(field, image) can be used to put an image.