Adding text AND button in column
Adding text AND button in column
![Apolymoxic](https://secure.gravatar.com/avatar/f31427d97a5b9c97b0e0aba76774e131/?default=https%3A%2F%2Fvanillicon.com%2Ff31427d97a5b9c97b0e0aba76774e131_200.png&rating=g&size=120)
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?
This discussion has been closed.
Answers
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.
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