why not dom: 'Bfltip' bind control in row?
why not dom: 'Bfltip' bind control in row?
var table = $('#tblContactList').DataTable({
data: JSON.parse(data.d),
dom: 'Bfltip',
lengthChange: true,
buttons: ['excel', 'colvis'],
"columns": [
{ "data": "ContactId" },
{ "data": "FirsrName" },
{ "data": "LastName" },
{ "data": "Email" },
{ "data": "PhoneNumber" },
{ "data": "IsDND" },
{ "data": "CreatedBy" },
{ "data": "CreatedDate" }
],
"columnDefs": [
{
"targets": [0],
"visible": false
},
{
"targets": [6],
"visible": false
}
],
'lengthMenu': [[10, 25, 50, -1], [10, 25, 50, 'All']],
});
table.buttons().container()
.appendTo('#tblContactList_wrapper .col-md-6:eq(0)');
},
This question has an accepted answers - jump to answer
Answers
Not sure I understand the question but my guess is you aren't seeing the buttons. You are trying to display the buttons using two different options; the -
option dom
option and direct insertion. Both are described here:https://datatables.net/extensions/buttons/#Displaying-the-buttons
You will want to use only one of these.
If this doesn't help please post more information about your question or problem. Also a link to your page or test case will give us the details needed to help debug.
https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case
Kevin
Thanks kthorngren for your help.my problem is solved.