Dataviewjs and taskList checking item does not update source when text modified?

Things I have tried

If I have just the dv.pages("").file.tasks used by dv.taskList I can check a item and the source updates, however unchecking does not.

If I update the display text of the items returned by pages(").file.tasks and check the item the source does not update.

Does the name of the task get wired in on the call back to match for update? Also is it expected that un checking a item would not uncheck the source?

What I’m trying to do

I am trying to make a tasks page with the list of tasks with certain tags removed and the backlink to the item being super short. So I can group by due today as an example using a date tag in the task and then click on it or click on the link to go to the source page in a more concise manner.

Here is the entire block I have been playing with:

const findDated = (task)=>{
 if( !task.completed && task.text.includes("#task") ) {
  if(task.text.includes(" ^")) {
  	const blockTag = task.text.match(/\^(\w{8})/);
	task.link = " " + "[[" + task.path + "#" + blockTag[0] + "|*]]";  
  } else {
  	task.link = " " + "[[" + task.path + "|*]]";  
  }
  task.date="";
  const found = task.text.match(/📅 ([12]\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01]))/);
  if(found) {
   	task.date = moment(found[1]);
	task.text = task.text.replace("📅 "+found[1],"")
  }
  task.text = task.text.replace("#task","")
  task.text = task.text + "("+task.date.format("MM/DD")+") " + task.link
  return true;  
 }
}
const myTasks =  dv.pages("").file.tasks.where(t => findDated(t));

dv.paragraph(dv.pages("").file.tasks[3])

dv.list( 
	myTasks.filter(t=> moment(t.date).isBefore(moment(),"day"))
		.sort(t=>t.date)
		.map(t=>[t.text]));
		
dv.taskList( 
	myTasks.filter(t=> moment(t.date).isBefore(moment(),"day"))
		.sort(t=>t.date), false);		

dv.table(["Overdue Tasks"], 
	myTasks.filter(t=> moment(t.date).isBefore(moment(),"day"))
		.sort(t=>t.date)
		.map(t=>[t.text]));

dv.table(["Today Tasks"], 
	myTasks.filter(t=> moment(t.date).isSame(moment(),"day"))
		.sort(t=>t.date)
		.map(t=>[t.text]));

dv.table(["Upcoming Tasks"], 
	myTasks.filter(t=> moment(t.date).isAfter(moment(),"day") && moment(t.date).isBefore(moment().add(14, 'days'),"day"))
		.sort(t=>t.date)
		.map(t=>[t.text]));


dv.table(["Undated Tasks"], 
	myTasks.filter(t=> !t.date)
		.sort(t=>t.date)
		.map(t=>[t.text]));
		

dv.header(1,"Future");
dv.table(["Task","link"], myTasks.filter(t=> t.text.includes("#future")).sort(t=>t.text).map(t=>[t.text, t.link]));

dv.header(1,"Supports Projects");
dv.table(["Task","link"], myTasks.filter(t=> t.text.includes("#projects")).sort(t=>t.text).map(t=>[t.text, t.link]));

dv.header(1,"Supports Areas");
dv.table(["Task","link"], myTasks.filter(t=> t.text.includes("#area")).sort(t=>t.text).map(t=>[t.text, t.link]));

dv.header(1,"Conversations");
dv.table(["Task","link"], myTasks.filter(t=> t.text.includes("#1")).sort(t=>t.text).map(t=>[t.text, t.link]));

dv.header(1,"Untagged");
dv.table(["Task","link"], myTasks.filter(t=> !t.text.includes("#")).sort(t=>t.text).map(t=>[t.text, t.link]));
1 Like

I think this is a question for plugin developer. He is very responsive.
Here’s the github link:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.