-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added DataTable to the project and configured columns.
- Loading branch information
aliarmaganuygun
committed
Oct 13, 2024
1 parent
8c57d0a
commit 4fe31df
Showing
6 changed files
with
58 additions
and
125 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ | |
<link rel="stylesheet" href="~/BookBazaar.styles.css" asp-append-version="true" /> | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.min.css"> | ||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/css/toastr.min.css"> | ||
<link rel="stylesheet" href="//cdn.datatables.net/2.1.8/css/dataTables.dataTables.min.css"> | ||
</head> | ||
<body> | ||
<header> | ||
|
@@ -62,6 +63,7 @@ | |
<script src="~/lib/bootstrap/dist/js/bootstrap.bundle.min.js"></script> | ||
<script src="https://cdn.tiny.cloud/1/idefu98uibhy9ivtvjypr8q08egl0jnbpqgo7ov2upvvqit8/tinymce/7/tinymce.min.js" referrerpolicy="origin"></script> | ||
<script src="~/js/site.js" asp-append-version="true"></script> | ||
<script src="//cdn.datatables.net/2.1.8/js/dataTables.min.js" asp-append-version="true"></script> | ||
@await RenderSectionAsync("Scripts", required: false) | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
| ||
$(document).ready(function () { | ||
loadDataTable(); | ||
}); | ||
|
||
function loadDataTable() { | ||
dataTable = $('#tblData').DataTable({ | ||
"ajax": { url: '/admin/product/getall' }, | ||
"columns": [ | ||
{ data: 'title', width: '25%' }, | ||
{ data: 'author', width: '15%' }, | ||
{ data: 'isbn', width: '15%' }, | ||
{ data: 'listPrice', width: '10%' }, | ||
{ data: 'category.name', width: '10%' }, | ||
{ | ||
data: 'id', | ||
"render": function (data) { | ||
return `<div class="w-75 btn-group" role="group"> | ||
<a href="/admin/product/upsert?id=${data}" class="btn btn-primary mx-2"><i class="bi bi-pencil-square"></i> Edit </a> | ||
<a href="/admin/product/delete/${data}" class="btn btn-danger mx-2"><i class="bi bi-trash-fill"></i> Delete </a> | ||
</div>` | ||
}, | ||
width: '25%' | ||
} | ||
] | ||
}); | ||
} |