Cannot see the button on each row
Cannot see the button on each row
denizdiana
Posts: 15Questions: 8Answers: 0
Hello everyone,
I want to add edit and delete button on each row but i cant see my buttons. Here is my script,
<
script>
$(document).ready(function () {
$('#table').DataTable(
{
ajax: {
"url": "myurl",
"type": "GET",
"datatype": "json",
"dataSrc": "person"
},
aoColumns: [
{ mData: 'name' },
{ mData: 'surname' },
{ mData: 'email' }
],
className: "center",
defaultContent: '<a href="" class="editor_edit">Edit</a> / <a href="" class="editor_remove">Delete</a>'
});
this is my links.,
<script type="text/javascript" src="https://cdn.datatables.net/v/dt/jq-3.3.1/dt-1.10.20/b-1.6.1/datatables.min.js"></script>
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/v/dt/jq-3.3.1/dt-1.10.20/b-1.6.1/datatables.min.css" />
I dont know why it is not working. Please help me
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
If you want to show the issue in a test case we can help debug.
https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case
Maybe one of these examples will help:
This uses
columns.render
:http://live.datatables.net/qemodapi/1/edit
This uses
columns.defaultContent
:http://live.datatables.net/xijecupo/1/edit
Kevin
Thank you Kevin, the second solution solved my problem.