I have a datatable in mvc
- $(document).ready(function () {
-
- $("#tblEmployee").dataTable({
-
- ajax: {
- type: "get",
- url: "/Employee/GetAllEmployee",
- dataType: "json",
- dataSrc: ""
-
- },
- columns: [{ 'data': 'Id' },
- { 'data': 'Name' },
- { 'data': 'Salary' },
- {
- 'data': 'Id', render: function (data, type, row) {
- return '<button class="btn btn-info btn-sm btnEdit" data-Id=' + row.Id + '>' + 'Edit' + '</button>';
-
- }
- },
- {
- 'data': 'Id', render: function (data, type, row) {
- return '<button class="btn btn-info btn-sm btnDelete" data-Id=' + row.Id + '>' + 'Delete' + '</button>';
-
- }
- }
- ]
-
-
- });
- });
Edit click is not firing
- $(".btnEdit").Click(function(){
-
- alert("hello");
-
- });