Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82244

How to add hyperlink in my DataTables to update my data.

$
0
0

How to add hyperlink in my DataTables to view the data details and also to update. I already tried but I got an Error When I click the Hyperlink in my table. How to fixed this error? Thanks.

Url.py
path('VM/Details/<int:pk>', vehicleMasterDetails.as_view(), name='vehicle_details'),

**Page not found (404)
Request Method: GET
Request URL: http://127.0.0.1:8000/vehicle_details/undefined**

    $(document).ready(function() {
        var table = $('#vtable').DataTable({
            "serverSide": false,
            "scrollX": true,
            "deferRender": true,
            "ajax": {
                "url": "/api/masterlist/?format=datatables",
                "type": "POST"
                },
            "columns": [
                {"data":"id", "name":"id",
                    fnCreatedCell: function (nTd, sData, data, iRow, iCol) {
                        $(nTd).html("<a href='/vehicle_details/"+data.id+"'>"+data.id+"</a>");
                    }
                },
                {"data": "Activity_Id"},
                {"data":"NO"},
                {"data":"PLATE_NO"},
                {"data":"CS_NO"},
                {"data":"CR_NAME"},
            ]
      });
    </script>

Viewing all articles
Browse latest Browse all 82244

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>