action buttons to jquery datable
action buttons to jquery datable
pall
Posts: 2Questions: 1Answers: 0
hi i have been having issues with adding a column to my datatable for actionlinks or buttons, do i need to do antything in the controller?coz it returns an empty column
$(document).ready(function () {
var table = $('#example').DataTable({
sScroll: "100%",
"sDom": "<'row'<'col-xs-6'T><'col-xs-6'f>r>t<'row'<'col-xs-6'i><'col-xs-6'p>>",
"oLanguage": {
"sLengthMenu": "_MENU_ records per page"
},
bProcessing: true,
sAjaxSource: '@Url.Action("action", "controller")',
aoColumns: [
null,
null,
null,
null,
null,
null,
{
"sName": "okid",
"bSearchable": true,
"bSortable": false,
"fnRender": function (oObj) {
return "<a href='/Edit?id="
+ oObj.aData[0] + "'>Edit</a>";
}
}
]
});
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
We'd need a link to a page showing the problem as required in the forum rules. Also note that
fnRender
was removed in v1.10.Allan
i didnt know that fnRender was removed, as i am a newbie, however how then would you add a hyperlink or crud buttons in a column using the datatable plug in
Use
columns.render
.Allan