0

In each row of the lightning datatable, I have a button. I want to replace the button with a lightning badge when an user clicks on the button. I wonder, how to implement this?

JS

    @track COLUMNS = [
    
          {
            label: "Name",
            type: "text",
        },
            {
              label: "Accept",
              type: "button",
              typeAttributes: {
                  label: "Accept",
                  name: "buttonName",
                  variant: "brand"
              }
          }
        ];

export default class MiscRecord extends LightningElement{
@recordId;
@wire(getData, {recordId: '$recordId'})
    Data;
handleRowAction(event) {

}
}

1 Answer 1

0

You would have to implement a custom type as mentioned here:

https://developer.salesforce.com/docs/component-library/documentation/en/lwc/lwc.data_table_custom_types

You must log in to answer this question.

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