Adding text AND button in column

Adding text AND button in column

ApolymoxicApolymoxic Posts: 15Questions: 4Answers: 0

I am trying to add a text AND button to a column. I can do one or the other, but can't seem to do both.

Doing something like this allows to add a button:

{"data": null,
"orderable": false,
"defaultContent": '<button title="Edit" id="boundEdit" class="Edit fa fa-pencil edit-icon"></button>',
"bSearchable": false}

But if I add a data value (such as "data": 'bookAuthor',), the button will only appear if the data value is null or blank. Is there a way to get BOTH to appear?

Answers

  • ApolymoxicApolymoxic Posts: 15Questions: 4Answers: 0

    I got this to work by button the text and the button in the default content.

    Simple enough, but I didn't think it would work with the JSON values.

  • allanallan Posts: 62,315Questions: 1Answers: 10,225 Site admin

    Good to hear you got it working - thanks for posting back. The other option is to use a renderer which provide access to the row's data should you need it for generating the HTML.

    Allan

This discussion has been closed.