You need to sign in to do that
Don't have an account?
VVH
on click action for specific column in data table
How to have on click action for specific column in data table in lwc.
consder this as example, js: columns = [ {label: 'Opportunity name', fieldName: 'opportunityName', type: 'text'},
{label: 'Confidence', fieldName: 'confidence', type: 'percent', cellAttributes: { iconName: { fieldName: 'trendIcon' }, iconPosition: 'right' }} ];
I want to open a modal by clicking on Confidence. if I give onclick in html, for example: <lightning-datatable data={data} columns={columns}" onclick={openmodal}> </lightning-datatable>
In this case modal will open wherever Iclick on data-table, instead of specific column.
Anyone know any solution for this?
Thanks in advance.
consder this as example, js: columns = [ {label: 'Opportunity name', fieldName: 'opportunityName', type: 'text'},
{label: 'Confidence', fieldName: 'confidence', type: 'percent', cellAttributes: { iconName: { fieldName: 'trendIcon' }, iconPosition: 'right' }} ];
I want to open a modal by clicking on Confidence. if I give onclick in html, for example: <lightning-datatable data={data} columns={columns}" onclick={openmodal}> </lightning-datatable>
In this case modal will open wherever Iclick on data-table, instead of specific column.
Anyone know any solution for this?
Thanks in advance.