Compare commits

..

No commits in common. "pagi" and "master" have entirely different histories.
pagi ... master

2 changed files with 3 additions and 48 deletions

View File

@ -4,17 +4,12 @@
<link rel="stylesheet" href="//cdn.datatables.net/2.3.2/css/dataTables.dataTables.min.css"> <link rel="stylesheet" href="//cdn.datatables.net/2.3.2/css/dataTables.dataTables.min.css">
</head> </head>
<body> <body>
<input type="text" placeholder="Name" />
<input type="text" placeholder="Phone" />
<button>Create</button>
<hr>
<table id="table-list"> <table id="table-list">
<thead> <thead>
<tr> <tr>
<th>ID</th> <th>ID</th>
<th>Name</th> <th>Name</th>
<th>Phone</th> <th>Phone</th>
<th>Act</th>
</tr> </tr>
</thead> </thead>
@ -25,7 +20,9 @@
<script src="https://code.jquery.com/jquery-3.7.1.min.js"></script> <script src="https://code.jquery.com/jquery-3.7.1.min.js"></script>
<script src="//cdn.datatables.net/2.3.2/js/dataTables.min.js"></script> <script src="//cdn.datatables.net/2.3.2/js/dataTables.min.js"></script>
<script src="js/carrack.js"></script> <script src="js/carrack.js"></script>
<script src="js/data.js"></script> <script>
var table = $('#table-list').DataTable({})
</script>
</body> </body>
</html> </html>

View File

@ -1,42 +0,0 @@
var table = $('#table-list').DataTable({
"ajax": {
"url": "http://localhost:11000/api/read",
"type": "POST",
"dataSrc": "data",
"contentType": "application/json",
"data": function(d) {
// Customize the data payload sent in the POST request
return JSON.stringify({});
},
"error": function (xhr, error, thrown) {
console.error('Error fetching data:', thrown);
console.error('Response:', xhr.responseText);
}
},
"columns": [
{
"data": "id",
"render": function(data, type, row) {
return data;
}
},
{
"data": "name",
"render": function(data, type, row) {
return data;
}
},
{
"data": "phone",
"render": function(data, type, row) {
return data;
}
},
{
"data": null,
"render": function(data, type, row) {
return `<button>Update</button> <button>Delete</button>`;
}
},
],
})