Add searching aspect in my code
Add searching aspect in my code

Hello!!
I try to use this one https://datatables.net/examples/api/form.html in my code
@model IEnumerable<ExportExcelDemo.Models.EmployeeViewModel>
<a class="btn btn-success" style="margin-bottom:10px" onclick="PopupForm('@Url.Action("AddOrEdit","Employee")')"><i class="fa fa-plus"></i> Add New</a>
EmployeeId | EmployeeName | Phone | Experience | |
---|---|---|---|---|
@item.EmployeeId | @item.EmployeeName | @item.Email | @item.Phone | @item.Experience |
@item.EmployeeId | @item.EmployeeName | @item.Email | @item.Phone | @item.Experience |
<link href="https://cdn.datatables.net/1.10.15/css/dataTables.bootstrap.min.css" rel="stylesheet" />
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" />
<link href="https://cdn.datatables.net/1.10.19/css/jquery.dataTables.min.css" rel="stylesheet" />
<a href="@Url.Action("ExportToExcel","Home")" class="btn btn-success"><i class="fa fa-file-excel-o"></i>Export Excel</a>
@section scripts{
<script src="//https://cdn.datatables.net/1.10.19/js/jquery.dataTables.min.js"></script>
<script>
$(document).ready(function () {
var table = $('#employeeTable').DataTable({
columnDefs: [{
orderable: false,
targets: [2, 3]
}]
});
$('button').click(function () {
var data = table.$('input, select').serialize();
alert(
"The following data would have been submitted to the server: \n\n" +
data.substr(0, 120) + '...'
);
return false;
});
});
</script>
}
But nothing is going on)
Could you help me?
Answers
Please be more descriptive of the problem. What happens or doesn't happen that you are expecting?
Do you get any alerts or errors in the browser's console?
The best thing to do is post a link to your page or a test case so we can help you debug.
https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case
Kevin