datacore icon indicating copy to clipboard operation
datacore copied to clipboard

example of Dataview TaskList equivalent

Open abruneau opened this issue 5 months ago • 3 comments

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?

abruneau avatar Aug 28 '25 08:08 abruneau

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.

sualk01 avatar Aug 28 '25 16:08 sualk01

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?

abruneau avatar Sep 02 '25 08:09 abruneau

Not yet, but should get implemented in the future, see roadmap

sualk01 avatar Sep 02 '25 12:09 sualk01