Render Id in anchor tag click datatable.
Here is the code:
- 'columnDefs': [
- {
- targets: 2,
- render: function (data, type, row, meta) {
- if (type === 'display') {
- data = ' + data["Id"] + '">' + data + '';
- }
- return data;
- }
- }
- ],
How do i pass the row value on id.
i.e. pass like @itm.Title on anchor tag click.
how do i get the id??
Here is the total code of datatable:
- $(document).ready(function ()
- {
- debugger
- $('#TableId').DataTable(
- {
- //"columnDefs": [
- // { "width": "5%", "targets": [0] },
- // {
- // "className": "text-center custom-middle-align",
- // "targets": [0, 1, 2, 3, 4, 5, 6]
- // },
- //],
- 'columnDefs': [{
- 'targets': 0,
- 'searchable': false,
- 'orderable': false,
- 'width': '1%',
- 'className': 'dt-body-center',
- 'render': function (data, type, full, meta) {
- return '';
- }
- }
- ,
- {
- targets: 2,
- render: function (data, type, row, meta) {
- if (type === 'display') {
- data = ' + data["Id"] + '">' + data + '';
- }
- return data;
- }
- }
- ],
- "language":
- {
- "processing": ""
- },
- "processing": true,
- "serverSide": true,
- "ajax":
- {
- "url": "/TicketTemplate/GetData",
- "type": "POST",
- "dataType": "JSON"
- },
- "columns": [
- { "data": '' },
- { "data": "CreatedDate" },
- { "data": "Title" },
- //{
- // //"data": "title",
- // "render": function (data, type, row, meta) {
- // //return '' + title + '';
- // return '' + data + '';
- // }
- //},
- //{
- // //"data": "title",
- // "render": function (data, type, row, meta) {
- // //return '' + title + '';
- // return "" + row.Title + " ";
- // }
- //},
- { "data": "Name" },
- { "data": "Email" },
- { "data": "AssignTo" },
- { "data": "Status" }
- ]
- });
- });
Manoj MaharanaPosted Mar 22, 2017, 11:25 AM
Ramesh PalanivelPosted Mar 22, 2017, 11:20 AM
Manoj MaharanaPosted Mar 22, 2017, 11:19 AM
Ramesh PalanivelPosted Mar 22, 2017, 11:12 AM
Manoj MaharanaPosted Mar 22, 2017, 11:10 AM
Ramesh PalanivelPosted Mar 22, 2017, 11:07 AM
Manoj MaharanaPosted Mar 22, 2017, 11:06 AM
Ramesh PalanivelPosted Mar 21, 2017, 1:33 PM
Vignesh ManiPosted Mar 21, 2017, 12:53 PM