I'm using a Lightning Aura component and lightning:listView. I wanna get the selected record from lightning:listView when I select the record like below img.

Successfully I get the selected record Id by using formula hyperlink, but it occurs page reload, and I don't wanna reload the page. And it should be clicked two times(double clicks).. so I wanna know how to choose a record by only one click.

Anyone knows how to get the selected record when select in lightning:listView?

enter image description here


Try This :

var tablecomp = component.find('WrapperTable');
selectedRows = tablecomp.getSelectedRows();

Where WrapperTable is auraid of your Lightning List View

  • Thank you for your answer. I wanna try it. But, how to call Javascript method from component? Like which event should be used? – Shinya Nov 7 '19 at 1:24
  • For that, I guess you'll need a button in your component to perform whatever action you need. The Button Click can be the event in that case. – Ajinkya Phadnis Nov 7 '19 at 6:23
  • I wasn't able to get getSelectedRows() to work at all. @AjinkyaPhadnis, can you provide the link to documentation where you found that? – Robert Hyatt Jan 22 at 19:04

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.