Skip to content
Snippets Groups Projects
Select Git revision
  • master
1 result

zs1-local-realm-guess

Blame
  • objects_subarrays.html 11.41 KiB
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    <html>
    	<head>
    		<meta http-equiv="content-type" content="text/html; charset=utf-8" />
    		<link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/media/images/favicon.ico" />
    		
    		<title>DataTables example</title>
    		<style type="text/css" title="currentStyle">
    			@import "../../media/css/demo_page.css";
    			@import "../../media/css/demo_table.css";
    		</style>
    		<script type="text/javascript" language="javascript" src="../../media/js/jquery.js"></script>
    		<script type="text/javascript" language="javascript" src="../../media/js/jquery.dataTables.js"></script>
    		<script type="text/javascript" charset="utf-8">
    			$(document).ready(function() {
    				var oTable = $('#example').dataTable( {
    					"bProcessing": true,
    					"sAjaxSource": "sources/objects_subarrays.txt",
    					"aoColumns": [
    						{ "mDataProp": "engine" },
    						{ "mDataProp": "browser" },
    						{ "mDataProp": "platform" },
    						{ "mDataProp": "details.0" },
    						{ "mDataProp": "details.1" }
    					]
    				} );
    			} );
    		</script>
    	</head>
    	<body id="dt_example">
    		<div id="container">
    			<div class="full_width big">
    				DataTables AJAX source example - array of objects with sub-arrays as a data source
    			</div>
    			
    			<h1>Preamble</h1>
    			<p>While the ability of DataTables to read arbitrary objects properties as a data source for any column is very powerful, it actually goes further than single level object properties; it is possible to read a data source for a column from a deeply nested array or property. This is specified in typical Javascript dotted object notation. For example "details.0" (used in this example) refers to the first property in an array called "details". "details.1" refers to the second property, etc. Object properties can also be used - for example "details.version" is perfectly valid, if that property is available in your data source.</p>
    			
    			<h1>Live example</h1>
    			<div id="dynamic">
    <table cellpadding="0" cellspacing="0" border="0" class="display" id="example">
    	<thead>
    		<tr>
    			<th width="20%">Rendering engine</th>
    			<th width="25%">Browser</th>
    			<th width="25%">Platform(s)</th>
    			<th width="15%">Engine version</th>
    			<th width="15%">CSS grade</th>
    		</tr>
    	</thead>
    	<tbody>
    		
    	</tbody>
    	<tfoot>
    		<tr>
    			<th>Rendering engine</th>
    			<th>Browser</th>
    			<th>Platform(s)</th>
    			<th>Engine version</th>
    			<th>CSS grade</th>
    		</tr>
    	</tfoot>
    </table>
    			</div>
    			<div class="spacer"></div>
    			
    			
    			<h1>Initialisation code</h1>
    			<pre class="brush: js;">$(document).ready(function() {
    	var oTable = $('#example').dataTable( {