<html>
<head>
<script src="https://code.jquery.com/jquery-1.11.3.min.js"></script>
<link href="https://nightly.datatables.net/css/jquery.dataTables.css" rel="stylesheet" type="text/css" />
<script src="https://nightly.datatables.net/js/jquery.dataTables.js"></script>
<meta charset=utf-8 />
<title>Requested Unknown Parameter - '[object Object]'</title>
</head>
<body>
<div class="container">
<table id="example" class="display nowrap" width="100%">
<thead>
<tr>
<th>Job Number</th>
<th>Details</th>
<th>Quantity</th>
<th>Required</th>
<th>Date Sort</th>
</tr>
</thead>
<tbody>
<tr class="eventRow">
<td>001</td>
<td>Task #1</td>
<td>100</td>
<td data-order="1496739600000">6th June 10:00</td>
<td>2017/06/06</td>
</tr>
<tr class="eventRow">
<td>002</td>
<td>Task #2</td>
<td>200</td>
<td data-order="1496739600000">6th June 10:00</td>
<td>2017/06/06</td>
</tr>
<tr class="eventRow">
<td>003</td>
<td>Task #3</td>
<td>300</td>
<td data-order="1496768400000">6th June 18:00</td>
<td>2017/06/06</td>
</tr>
<tr class="eventRow">
<td>004</td>
<td>Task #4</td>
<td>400</td>
<td data-order="1497182400000">11th June 13:00</td>
<td>2017/06/07</td>
</tr>
<tr class="eventRow">
<td>005</td>
<td>Task #5</td>
<td>500</td>
<td data-order="1496818800000">7th June 08:00</td>
<td>2017/06/11</td>
</tr>
</tbody>
</table>
</div>
<br>
<button id="getData" type="button">Receive Data</button>
<button id="deleteData" type="button">Delete Data</button>
</body>
</html>
body {
font: 90%/1.45em "Helvetica Neue", HelveticaNeue, Verdana, Arial, Helvetica, sans-serif;
margin: 0;
padding: 0;
color: #333;
background-color: #fff;
}
var fauxData = {
serverData: [{ j: "006", d: "Task #6", q: "600", r: "15th June 09:00", s: "2017/06/15", e: "1497513600000" }, { j: "007", d: "Task #7", q: "700", r: "9th June 14:00", s: "2017/06/09", e: "1497013200000" }]
};
$(document).ready( function () {
var table = $('#example').DataTable({
"columnDefs": [
{ "visible": false, "targets": 4 }
],
"responsive": true,
"lengthChange": false,
"searching": false,
"paginate": false,
"info": false,
"orderFixed": [
[3, "asc"],
[0, "asc"],
],
"drawCallback": function ( settings ) {
var api = this.api();
var rows = api.rows().nodes();
var last = null;
api.column(4).data().each( function ( group, i ) {
if ( last !== group ) {
$(rows).eq( i ).before(
'<tr><td colspan="4"><b>' + group + '</b></td></tr>'
);
last = group;
}
});
},
});
$("#getData").on('click', function(){
$.each(fauxData.serverData, function(index, value) {
var row = $('#example').DataTable().row.add(
$('<tr class="eventRow">'+
'<td>'+value.j+'</td>'+
'<td>'+value.d+'</td>'+
'<td>'+value.q+'</td>'+
'<td data-order="'+value.e+'">'+value.r+'</td>'+
'<td>'+value.s+'</td>'+
'</tr>')[0]
).node();
$(row).find('td').eq(3).attr('data-order', value.e);
});
$('#example').DataTable().draw();
});
$("#deleteData").on('click', function(){
rowsToDelete = $(".eventRow:eq(0)");
console.log(rowsToDelete);
$('#example').DataTable().rows(rowsToDelete).remove().draw();
});
});
You can jump to the latest bin by adding /latest
to your URL
Shortcut | Action |
---|---|
ctrl + [num] | Toggle nth panel |
ctrl + 0 | Close focused panel |
ctrl + enter | Re-render output. If console visible: run JS in console |
Ctrl + l | Clear the console |
ctrl + / | Toggle comment on selected lines |
ctrl + [ | Indents selected lines |
ctrl + ] | Unindents selected lines |
tab | Code complete & Emmet expand |
ctrl + s | Save & lock current Bin from further changes |
ctrl + shift + s | Clone Bin |
ctrl + y | Archive Bin |
Complete list of JS Bin shortcuts |
URL | Action |
---|---|
/ | Show the full rendered output. This content will update in real time as it's updated from the /edit url. |
/edit | Edit the current bin |
/watch | Follow a Code Casting session |
/embed | Create an embeddable version of the bin |
/latest | Load the very latest bin (/latest goes in place of the revision) |
/[username]/last | View the last edited bin for this user |
/[username]/last/edit | Edit the last edited bin for this user |
/[username]/last/watch | Follow the Code Casting session for the latest bin for this user |
/quiet | Remove analytics and edit button from rendered output |
.js | Load only the JavaScript for a bin |
.css | Load only the CSS for a bin |
Except for username prefixed urls, the url may start with http://jsbin.com/abc and the url fragments can be added to the url to view it differently. |