I doesn't work. It looks like this part of code is ignored. I see that there is an error in execution of code because other my customization doesn't work but when I click Title link a standard dialog with default form is opening. Title is main link on the list.
Correct me if I wrong, but when URL is wrong there should be an Error 404? Even if I wrote wrong URL I should see a dialog window with info that page doesn't exist. Instead of this I got default form.
I'll check this code once again. Maybe I missed something.
Dear @wflorczyk,
Can you just copy and paste the code as you have it, so I can try it as well? I am also interested in the URL, so if you can - do not change it (or change it slightly, for example, only the domain) that would be good.
Dear @wflorczyk,
Since we're testing specifically this functionality, I would ask to remove the rest of the code for now, and just focus on changing the Title field leaving only this on the form for now:
fd.spRendered(function() {
fd.control('SPDataTable1').templates = {
// Open Predecessors lookup in a dialog
Title: function(ctx) {
console.log(ctx);
var value = ctx.row.Title;
if (!value) {
return '';
}
return '<a target="_blank" data-interception="off" ' +
'onclick="window[\'' + ctx.openDialogFuncName + '\'](\'https://domain.sharepoint.com/sites/sitename/SitePages/PlumsailForms/ListName/Item/EditForm.aspx?item=' + ctx.row.ID + '\'); return false;" ' +
'href="https://domain.sharepoint.com/sites/sitename/SitePages/PlumsailForms/ListName/Item/EditForm.aspx?item=">' + value + '</a>';
}
}
})
Don't use value.map() or join() - these are not needed here. Also, use the site's URL instead of window.siteName - just follow the example.
This is code. The resulat in attachment. Two different outcomes depends on setting of component. Edit Inline (only one empty row) and Dialog (all rows but all empty).
fd.spRendered(function () {
fd.control('SPDataTable1').templates = {
// Open Predecessors lookup in a dialog
Title: function(ctx) {
console.log(ctx);
var value = ctx.row.Title;
if (!value) {
return '';
}
return '<a target="_blank" data-interception="off" ' +
'onclick="window[\'' + ctx.openDialogFuncName + '\'](\'https://mycompany.sharepoint.com/sites/devrepo/SitePages/PlumsailForms/Elementy%20stanowisk/Item/DisplayForm.aspx?item=' + ctx.row.ID + '\'); return false;" ' +
'https://mycompany.sharepoint.com/sites/devrepo/SitePages/PlumsailForms/Elementy%20stanowisk/Item/DisplayForm.aspx?item=">' + "Random" + value + '</a>';
}
} });