You need to sign in to do that
Don't have an account?
DML2020
Filter results for LWC that includes a search field
Within the LWC, there exists a search field which displays properties for the user to select. The html file contains the following:
<lightning-layout multiple-rows class="slds-var-p-bottom_small"> <lightning-layout-item size="4"> <lightning-input type="search" label="Search Properties" onchange={handleSearch} class="slds-var-p-right_small"> </lightning-input> </lightning-layout-item>
which is dictated by the following in the js file as follows:
handleSearch(event) { const searchFields = ['name', 'propertyId', 'address']; this.template .querySelector('c-datatable') .search(event.target.value, searchFields); }
Question: The properties that are returned have a status of either ACTIVE or INACTIVE. However, the requirement is for the properties to return ones ONLY with the status of ACTIVE (filter for only ACTIVE status on the record and exclude those of INACTIVE status).
Where would I navigate to edit the filter to make the update to accomplish this?
How is the c-datatable component structured? Is it a custom component, and does it have a method like search or updateProperties that can be used to filter and update the displayed properties?
Related posts:
https://salesforce.stackexchange.com/questions/300822/lwc-lookup-filter-based-on-account-lookup
https://www.salesforceben.com/building-a-lightning-web-component-lwc-to-filter-related-records/
https://studysection.com/blog/how-to-show-list-of-related-records-using-search-filter-in-lwc/
https://www.infallibletechie.com/2022/01/filtersearch-in-lightning-datatable-in.html
Thanks