datacore
datacore copied to clipboard
example of Dataview TaskList equivalent
Hello, I’m looking for an example of how to display a To-Do list similar to the Dataview TaskList. I can retrieve tasks with a query, but I haven’t been able to render them correctly. Could someone please help me?
return function TasksView() {
const tasks = dc.useQuery("@task");
return <dc.List rows={tasks}
type="block"
renderer={i => `- [${i.$status}] ${i.$text}`}
/>; // or use renderer={dc.embed} instead
}
There are more examples and explanations here.
Here is what worked for me
<dc.List
rows={tasks}
childSource="$elements"
renderer={(i) => `- [${i.$status}] ${i.$text}`}
/>
Is there a way to update the status of the original task from this?
Not yet, but should get implemented in the future, see roadmap