How can I get edit button in last column server side processing asp.net mvc?
How can I get edit button in last column server side processing asp.net mvc?
Oli
Posts: 2Questions: 1Answers: 0
I am having an ASP.Net MVC 5 application in which I am using DataTables 1.10.10.
I am doing server side paging and sorting.
How can I add an edit button in last column of each row which take MemberId field (which is first column) value to some controller action method?
My code is
Jquery Code is
$(document).ready(function () {
$("#membersTable").DataTable({
"processing": true,
"serverSide": true,
"orderMulti": false,
"dom": '<"top"i>rt<"bottom"lp><"clear">',
"ajax": {
"url": "/Members/LoadData",
"type": "POST",
"datatype": "json"//,
},
"columns": [
{ "data": "MemberId", "name": "MemberId", "autoWidth": true },
{ "data": "Name", "name": "Name", "autoWidth": true },
{ "data": "Gender", "name": "Gender", "autoWidth": true },
{ "data": "PostalAddress", "name": "PostalAddress", "autoWidth": true //}
],
});
oTable = $('#membersTable').DataTable();
$('#btnSearch').click(function () {
oTable.columns(0).search($('#searchButton').val().trim());
oTable.draw();
});
});
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
A rendering function is probably the best way.
Allan
Thanks allan