Add total number of Rows
Add total number of Rows
I am dynamically appending data to a tr and want to add number of rows to the bottom of the table. Below is my code. Any ideas will be appreciated.
- $('#admin').change(function() {
- var select = $("#admin option:selected").val();
- $.ajax({
- cache: false,
- async: false,
- type: "GET",
- url: "@(Url.Action("Employees", "Details"))",
- dataType: 'json',
- data: { "id": select },
- success: function(data) {
- $("#admin").val(select);
- var target = $("#LoadEmployees");
- target.empty();
- for (var i = 0; i < data.length; i++) {
- var item = data[i];
- target.append("<tr><td>" +
- item.EmpId +
- "</td><td>" +
- item.ManagerId +
- "</td><td>" +
- item.AdminId +
- "</td><td>" +
- item.EmpNumber +
- "</td><td>" +
- item.EmpName +
- "</td><td>" +
- item.ManagerNumber +
- "</td><td>" +
- item.ManagerName +
- "</td><td>" +
- item.AdminNumber +
- "</td><td>" +
- item.AdminName +
- "</td><td>" +
- item.LoadEmployees +
- "</td><td>" +
- item.Permissions +
- "</td></tr>");
- }
- },
- error: function(xhr, thrownError) {
- }
- });
- });