devoooo4u / spfx-task-list-web-part

8 stars 7 forks source link

Hard coded "Tasks" in the action URL #10

Open jzhou888 opened 3 years ago

jzhou888 commented 3 years ago

Hi there, I have downloaded your source code for this SPFx webpart and loaded it in VS on my computer. During the test with workbench and I found the actionurl with a hard coded "Tasks" for editting. See the actual line of code below.

actionUrl = this.BaseUrl() + /Lists/Tasks/EditForm.aspx?ID= + element['Id'] + '&Source=' + this.BaseUrl() + '/SitePages/Dashboard.aspx';

My question is how can I change that "Tasks" in the URL with a dynamic variable since we have many different task lists in a site collection. I tried to get the value from the list properties.listTitle, but it gives me the list GUID instead of display name. I am new to Typescript...can you advise how I can achieve that.

Thank you very much! James

Robbayly commented 3 years ago

Hi James

First up - thanks DvG for the example, nice work.

James - you need to comment out DvG's meetingminutes code to strip it back to strictly Task based, and dynamic list. I also noted that SPO task list edit form syntax has changed.

Updated TaskListViewModel.ts text attached TaskListViewModel.ts.txt