jQuery Table with .NET Core MVC (Grid View Data Representations) | Sukhraj

preview_player
Показать описание
In this video I have explained, How to use Jquery DataTable with Searching, Paging and Sorting in .net Core MVC.

#jQueryTable #DotNetCoreMVC
Рекомендации по теме
Комментарии
Автор

<script>

$(document).ready(function () {
$("#empTable").dataTable({
"processing": true, // for show progress bar
"serverSide": true, // for process server side
"filter": true, // this is for disable filter (search box)
"orderMulti": false, // for disable multiple column at once
"ajax": {
"url": "/Home/GetData",
"type": "POST",
"datatype": "json"
},
"columnDefs": [{
"targets": [0],
"visible": false,
"searchable": false
}],
"columns": [
{ "data": "EmployeeID", "autoWidth": true },
{ "data": "FirstName", "autoWidth": true },
{ "data": "LastName", "autoWidth": true },
{ "data": "Education", "autoWidth": true },
{ "data": "City", "autoWidth": true },
{
"render": function (data, type, row, meta)
{ return '<a class="btn btn-info" href="/Home/Edit/' + row.EmployeeID + '">Edit</a>'; }
},
{
data: null,
render: function (data, type, row) {
return "<a href='#' class='btn btn-danger' onclick=DeleteData('" + row.EmployeeID + "'); >Delete</a>";
}
},
]

})
});


function DeleteData(EmployeeID) {
if (confirm("Are you sure you want to delete ...?")) {
Delete(EmployeeID);
} else {
return false;
}
}


function Delete(EmployeeID) {

$.post(url, { ID: EmployeeID }, function (data) {
if (data) {
oTable = $('#empTable').DataTable();
oTable.draw();
} else {
alert("Something Went Wrong!");
}
});
}


</script>

SukhrajMohammad
Автор

hi, thankyou for video
but where is the next session?
because your result id different from table in start of video

mmmmhhhh
Автор

2:02 GetAllEmployee() ===> unable to understand

codingislife
Автор

Is there a server side implementation for this? I've a table with huge amount of data that is growing every year. Fetching all the records at once is out of the question.

bkcy
Автор

Do you have sample project & code available so we don't have to write it all out to test this method?

khoantum
Автор

How we should add multiple functions of filter and search

RememberRund
Автор

why are you using [HttepPost] verb for getting the data from database?

saurabhsingh-fm
Автор

I m trying to find the same which explains jQuery table

kumarchandan
visit shbcf.ru