action buttons to jquery datable

action buttons to jquery datable

pallpall Posts: 2Questions: 1Answers: 0
edited May 2014 in DataTables

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

Answers

  • allanallan Posts: 63,692Questions: 1Answers: 10,500 Site admin
    Answer ✓

    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

  • pallpall Posts: 2Questions: 1Answers: 0

    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

  • allanallan Posts: 63,692Questions: 1Answers: 10,500 Site admin

    Use columns.render.

    Allan

This discussion has been closed.