Search-reactive dynamic data table - object agnostic and easily configurable
- Leverages lightning-datatable
- Object-agnostic - can be used with any standard or custom object
- Easily configurable - just configure the parameters with desired object name, fields, where clause, etc
- Reusable - configure multiple instances across objects without updating the code
- Ability to use dynamic id fields in optional where clause
- Ability to configure multiple search fields (not just Name) to bind to lookup search query
- Ability to display other fields (like Email and Phone for example) in the search results
- Reusable - no need to edit the code, just adjust config parameters
- Also supports inline editing of picklist fields and lookup fields
Deploy to salesforce: https://live.playg.app/play/reactive-dynamic-data-table
Syntax:
<c-dynamic-data-table-with-search
title="Contact lookup/selection"
icon-name="standard:contact"
obj-api-name="Contact"
field-paths="Id, Name, Phone, Email"
field-paths-for-search="Name, Email"
where-clause="AccountId = :recordId ORDER BY Name"
actions-str="view, edit"
hide-checkbox-column="false"
record-id={recordId}
placeholder="Lookup record..."
onrowstoggled={rowToggleHandler}
>
</c-dynamic-data-table-with-search>


