Rendering task states in a query

Hi, I’ve wrote a query like:

# Checklist
${query[[
  from item = index.tag "task"
  where
    table.includes(item.itags, "project")
    and not item.done
  order by
    item.page,
    item.pos
  select {
    state = "[" .. item.state .. "]",
    ref = item.ref,
    name = item.name
  }
]]}

And it shows:

… Yes, I’m not using taskItem template, because I prefer the table form than the list.

How can i render state columns as checkboxes?

HTML input checkbox widget, with the checked attribute being item.state
EDIT: rendering elements doesn’t work as expected with the default tables… you’d probably have to render it out yourself

1 Like

I’ve yielded rendering to a function for the future:

...
  select {
    state = RenderCheckbox(item)
...
function(task)
  return "[" .. task.state .. "]"
end