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

  Рет қаралды 16,648

Sukhraj Mohammad

Sukhraj Mohammad

Күн бұрын

Пікірлер: 21
@SukhrajMohammad
@SukhrajMohammad 3 жыл бұрын
$(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 'Edit'; } }, { data: null, render: function (data, type, row) { return "Delete"; } }, ] }) }); function DeleteData(EmployeeID) { if (confirm("Are you sure you want to delete ...?")) { Delete(EmployeeID); } else { return false; } } function Delete(EmployeeID) { var url = '@Url.Content("~/")' + "Home/Delete"; $.post(url, { ID: EmployeeID }, function (data) { if (data) { oTable = $('#empTable').DataTable(); oTable.draw(); } else { alert("Something Went Wrong!"); } }); }
@shifamalik3021
@shifamalik3021 4 жыл бұрын
Keep it up!
@joydeepsingh1681
@joydeepsingh1681 4 жыл бұрын
Nicely explained!
@SukhrajMohammad
@SukhrajMohammad 4 жыл бұрын
Glad it was helpful!
@RememberRund
@RememberRund Жыл бұрын
How we should add multiple functions of filter and search
@masumehoseini8370
@masumehoseini8370 Жыл бұрын
hi, thankyou for video but where is the next session? because your result id different from table in start of video
@SukhrajMohammad
@SukhrajMohammad Жыл бұрын
Next session was not uploaded but you can find the code in pinned comment
@saurabhsingh-f2m
@saurabhsingh-f2m Жыл бұрын
why are you using [HttepPost] verb for getting the data from database?
@SukhrajMohammad
@SukhrajMohammad Жыл бұрын
Because mine C# code function is with httpPost , you can try with Get,it will work...
@kumarchandan019
@kumarchandan019 4 жыл бұрын
I m trying to find the same which explains jQuery table
@codingislife6387
@codingislife6387 2 жыл бұрын
2:02 GetAllEmployee() ===> unable to understand
@SukhrajMohammad
@SukhrajMohammad 2 жыл бұрын
GetAllEmployees is function/method written in C# code to get list of Employees from database, It is returning List and then I am converting this collection to json format and returning back to jQuery Datatable
@charlesmcclellan8212
@charlesmcclellan8212 2 жыл бұрын
@@SukhrajMohammad I am new and trying to understand this as well. How does the function in the Home Controller access the GetAllEmployee list? This is at 13 minutes and 14 seconds on line 31 of the HomeController
@SukhrajMohammad
@SukhrajMohammad 2 жыл бұрын
GetAllEmployee() is private method inside the controller which is returning the list of Employees. For demo purpose I have created this method inside the controller otherwise we should have this method in service class and using service class instance should call in Controller.
@bkcy18
@bkcy18 Жыл бұрын
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.
@SukhrajMohammad
@SukhrajMohammad Жыл бұрын
Yes, we can use pagination with server side logic, where we will use logic to get data for current page only,but in that case sorting and search also post back to server to get data..
@mohammadrezakazemiesfeh2294
@mohammadrezakazemiesfeh2294 Жыл бұрын
Thanks
@AmirKhan-sh7tb
@AmirKhan-sh7tb 4 жыл бұрын
Nyc
@khoantum
@khoantum 2 жыл бұрын
Do you have sample project & code available so we don't have to write it all out to test this method?
@SukhrajMohammad
@SukhrajMohammad 2 жыл бұрын
unfortunately, not available at the moment
@techplusglobalsolutions4956
@techplusglobalsolutions4956 2 жыл бұрын
👍
Cross origin resource sharing (CORS) DotNet Core Web API
17:25
Sukhraj Mohammad
Рет қаралды 579
24 Часа в БОУЛИНГЕ !
27:03
A4
Рет қаралды 7 МЛН
УЛИЧНЫЕ МУЗЫКАНТЫ В СОЧИ 🤘🏻
0:33
РОК ЗАВОД
Рет қаралды 7 МЛН
I Sent a Subscriber to Disneyland
0:27
MrBeast
Рет қаралды 104 МЛН
jQuery Datatable and Asp.Net MVC Integration
26:53
CodAffection
Рет қаралды 115 М.
ASP.NET Core Crash Course - C# App in One Hour
1:00:44
freeCodeCamp.org
Рет қаралды 1,6 МЛН
How To Implement Search Functionality In ASP.NET Core MVC Index View VS2019
13:50
Haritha Computers & Technology
Рет қаралды 42 М.
Learn Database Normalization - 1NF, 2NF, 3NF, 4NF, 5NF
28:34
Decomplexify
Рет қаралды 2,2 МЛН