function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Sara Massey 10Sara Massey 10 

I would like to create a lightning component with a datatable that allows for searching and selectable rows.

Since the library provides the component code for the searchable datatable separate from the component code for the selectable row datatable, how can I combine the functionality / code?  would i create two methods in the .JS controller?  or would I create the two components separately adn then include them in the same app?  My goal is to have a datatable for a custom object (activity_Code__c) so that the user can

1. search for the records (activity codes) they need 
2. take these selections and use them to create another custom object (labor_efficiency_line_Item__c). . 

so the action would not be 'delete' or 'view details' as in the component example code, but rather I would need to take the IDs from the rows selected and use them to generate a new custom object for each selected code (I am thinking I would need to do that in the apex controller - but not sure..)  any suggestions are appreciated! 
ANUTEJANUTEJ (Salesforce Developers) 
Hi Sara,

Can you try checking the below link that has a similar use case:

>> https://salesforce.stackexchange.com/questions/254505/how-to-use-search-functionality-with-multiple-fields-in-lightning-components

Let me know if this helps.

Regards,
Anutej
Sara Massey 10Sara Massey 10
Thx Anutej...  yes, this does definitely seem to match the use case that I have as well!  I will review the code and see if I can apply it our scenario!  will let you know how this goes..  thank you! Sara
ANUTEJANUTEJ (Salesforce Developers) 
Let me know if it works, glad I was able to find a link that could help :)