I have a Lightning Data table in my LWC. It is populated with line item data from an external source through apex. I want the data table to open in a new tab when a button is clicked.
Currently it is opening a new tab with the salesforce url and gives a message "This page is not available in Lighting...". The line items are not records but just text.
I have tried the following. I don't need a specific url as its just a tab to show the data table which is populated by apex callout:
<lightning-button label="google" title="Non-primary action" onclick={handleClick} class="slds-align_absolute-center"></lightning-button>
handleClick() {
var url = "www.google.com";
window.open(url, "_blank");
}
I have also tried with _blank and _parent:
<a href="www.google.com" target="_blank">Go to Site</a>