I've got a lightning:dataTable
I'm working on for a client. One of the columns is of type URL, and it links to a Visualforce PDF. It is defined in the columns
attribute as:
{
sortable:true,
label: 'Invoice No.',
fieldName: 'urlField__c',
type: 'url' ,
typeAttributes: {
label: { fieldName: 'Invoice_Number__c' },
target:'_blank'
}
}
When the component loads, I can "Inspect Element" in Chrome and see that the URL correctly has target=_blank
. However clicking it always opens the PDF in the same window under the Lightning header instead of popping open a new one. Then the user has to hit the back button to return to where they were which is not intuitive.
Is there anything I can do to force it to a new window?
Best Answer
typeAttributes: {label: { fieldName: 'Invoice_Number__c' }, target: '_top'}},