<html>
<head>
<meta charset="UTF-8">
<title>DataTables scroll test</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://cdn.datatables.net/1.10.19/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/scroller/2.0.0/js/dataTables.scroller.min.js"></script>
<link href="https://cdn.datatables.net/1.10.19/css/jquery.dataTables.min.css" rel="stylesheet" type="text/css"/>
<link href="https://cdn.datatables.net/scroller/2.0.0/css/scroller.dataTables.min.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<h3>
Table has 45000 rows. Scroll to row 44500 works fine. 44600 or 44700 scroll to wrong row, yet 44800 works fine.
</h3>
<button>Scroll</button> to row
<input id="row" type="number" style="width:60px;" value=44600 />
<div>
<table id="data_table" class="cell-border">
</table>
</div>
</body>
<script>
$(function () {
var rows = [];
for (var i=0; i < 45000; ++i) {
rows.push( {row_index: i, alogp: (10.*Math.random()-5.0).toFixed(2)} );
};
var columns = [
{name: "row_index", title: "row_index", data:"row_index"},
{name: "alogp", title: "alogP", data:"alogp"}
];
var dt = $("#data_table").DataTable({
data: rows,
columns: columns,
scroller: true,
scrollY: 400,
scrollX: 200
});
$("button").click( function(event) {
var row = $("#row").val();
//dt.scroller.measure(); // has no effect on mis-scrolling to 44600
dt.row(row).scrollTo(false);
});
});
</script>
</html>
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. |