Skip to content

Instantly share code, notes, and snippets.

Created April 24, 2015 18:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/d3d8245eacd025ad4653 to your computer and use it in GitHub Desktop.
Save anonymous/d3d8245eacd025ad4653 to your computer and use it in GitHub Desktop.
body {
font: 90%/1.45em "Helvetica Neue", HelveticaNeue, Verdana, Arial, Helvetica, sans-serif;
margin: 0;
padding: 0;
color: #333;
background-color: #fff;
}
div.container {
min-width: 980px;
margin: 0 auto;
}
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-1.11.1.min.js"></script>
<link href="//datatables.net/download/build/nightly/jquery.dataTables.css" rel="stylesheet" type="text/css" />
<script src="//datatables.net/download/build/nightly/jquery.dataTables.js"></script>
<meta charset=utf-8 />
<title>DataTables - JS Bin</title>
</head>
<body>
<table id="example" class="display" cellspacing="0" width="100%">
</table>
</body>
</html>
$(document).ready(function() {
localStorage.setItem('z', JSON.stringify({data: [{ id: 2 }]}));
var dt = $('#example').dataTable({
"processing": true,
"serverSide": true,
columns: [
{
name: 'id',
data: 'id'
}
],
ajax: function (data, callback, settings) {
callback(
JSON.parse(localStorage.getItem('z'))
);
}
});
//dt.api().columns([0]).visible(false);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment