I have a lightning:datatable which have a few columns. The first column is of type url.

     columns = {!v.columns}"
    onrowaction="{!c.handleRowAction}" />

In the controller,I have defined a column of type url.

type: "url",  fieldName: "ConfirmOrder", label: 'Action', typeAttributes: {label: 'Confirm/Reject'}}

Now, when a user clicks on the column, then i want to pass recordId and show another lightning:component.

Is it possible in lightning:datatable, as i am not able to do so?

  • Are you trying to navigate to a URL-addressable component, or take some other action like presenting a Quick Action or re-rendering portions of your current page? – David Reed Nov 21 '18 at 1:27
  • Yes, I am trying to navigate to a URL-addressable component. – lambad Nov 21 '18 at 1:32
  • to open a different lightning component it is best to use an action or a button type column and not a url, then easily you can take the recordId from the javascript – Itai Shmida Nov 25 '18 at 7:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.