TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Ramco Ramco
443
3.4k
526.9k
Table not showing as Jquery Datatable
May 30 2021 10:07 AM
Hi
It is showing error -
Uncaught TypeError: Cannot read property 'mData' of undefined
at HTMLTableCellElement.<anonymous> (jquery.dataTables.min.js:90)
Location.js
$(document).ready(function () {
$("#tblLocation").dataTable({
});
});
***********************
@model IEnumerable<MyApplication.Models.Location>
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width" />
</head>
<body>
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#myModal" onclick="clearTextBox();">Add New Location</button><br /><br />
<table class="table" id="tblLocation">
<tr>
<th>
@Html.DisplayNameFor(model => model.Id)
</th>
<th>
@Html.DisplayNameFor(model => model.Description)
</th>
<th>
@Html.DisplayNameFor(model => model.IsActive)
</th>
</tr>
@foreach (var item in Model)
{
<tr>
<td>
@Html.DisplayFor(modelItem => item.Id)
</td>
<td>
@Html.DisplayFor(modelItem => item.Description)
</td>
<td>
@Html.DisplayFor(modelItem => item.IsActive)
</td>
<td><a href="#myModal" data-id="@item.Id" class="btn btn-primary btn-xs" data-title="Edit" data-toggle="modal"><span class="glyphicon glyphicon-pencil"></span></a>
<a href="#myModal" data-id="@item.Id" class="btn btn-primary btn-xs" data-title="Delete" data-toggle="modal"><span class="glyphicon glyphicon-remove"></span></a></td>
</tr>
}
</table>
</body>
</html>
<script src="~/Scripts/Appjs/Location.js"></script>
Thanks
Reply
Answers (
2
)
LTS, Current and EOL , what to choose and why?
How to pass values on click of Edit/Delete