I developed a datatable with dynamic columns. I've a URL column and a column with a button. Now I'd like to merge these two columns. If a record value exists, I'll show URL link and of values doesn't exist, I want to show button. Following is the existing implementation:

Controller js:

                     var headers = [];
                        label : record.Label,
                        fieldName : 'linkName1',
                        type : 'url',
                        typeAttributes: innerHeaders,
                        target: '_blank'
                        label : 'Click Here',
                        fieldName : 'Click Here',
                        type : 'button',
                        typeAttributes: {
                        label: 'Click Here',
                        iconPosition: 'left'

Above code displays two columns separately , but how do I make it to display url and button in same column.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.