Closed banderson-stripe closed 1 year ago
@pozil. Just wanted to give you an update.
@surajp was able to help me resolve this issue. It's actually very simple and elegant:
{ label: 'foo', fieldName: 'foo', type: 'customTypeLookup', typeAttributes: {'onseach':this.handleSearchFunction} }
which then gets passed to the customTypeLookupEdit.html
<template>
<c-lookup onsearch={typeAttributes.onsearch}></c-lookup>
</template>
Wow, that was fast! I'm glad that you figured it out. This is what I was going to recommend, but I wanted to try it out first, just in case :)
@pozil only issue is the base lightining-datatable
is not allowing the result dropdown to expand due to a slds-truncate
CSS class that is part of the base component on the table
Damn. Perhaps you need to open a modal with lookup then? Not the best UX but I don't see how you can avoid it if you want to keep the datatable.
I am trying to implement the Lookup component in a Custom Data Type for the
lightning-datatable
The issue I am having is where do I put the
onsearch
event so that I can capture theevent.target
correctly to then be able to call thesetSearchResults()
method correctly.This stackexchange also describes the same issue: https://salesforce.stackexchange.com/questions/270252/event-getsource-alternative-in-lwc-considering-origin-reparenting
Here is my setup:
customTypeLookupEdit.html
customDatatable.js
actualComponent.html
actualComponent.js