0

Between this salesforce guidance and inspiration from this popular playground lwc I've arrived at my near working solution.

This screenshot kinda says it all. When I was on row 1, I already clicked the pencil icon and selected an option from my lightning-combobox.. and notice the yellow highlight: good, however when the editTemplate pop-up exited, the default template remains blank: bad

Before taking the screenshot, I clicked the pencil icon on row 2 so you could see again what the editTemplate looks like in action:

lightning-datatable with custom dropdown

The field is correctly highlighted in yellow by the lighting-datatable component - it properly recognizes my interaction with the custom editTemplate that I designed. And if I save my data, the draftValues have been properly updated so the correct changed-data will be submitted. But, why can't I get the editValue to populate back to the default non-interactive template

screenshot of rossDataTable.js

picklist-template-edit.html (works just like I want)

<template>
    <c-ross-datatable-picklist 
        data-inputable="true"
        fieldname={columnLabel} 
        value={editedValue}
        placeholder={typeAttributes.placeholder} 
        options={typeAttributes.options} 
        context={typeAttributes.context}>
    </c-ross-datatable-picklist>
</template>

picklist-template.html (this is my conundrum. how to make it show edited value?)

<template>
    <p>{typeAttributes.value}</p>
</template> 
2
  • Would you be able to share the contents of c-ross-datatable-picklist? am trying to do the same and somehow when I change values in combobox they're not updating :(
    – zaitsman
    Commented Jun 7 at 1:57
  • I got mine from here. Just click on the "components" tab, and see the datatablePicklist.html they have there
    – bkwdesign
    Commented Jun 7 at 13:23

1 Answer 1

2

I figured it out.

My picklist-template.html should be like this:

<template>
    <p>{value}</p>
</template>

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .