1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
| <!DOCTYPE html>
<html lang="fr">
<head>
<base href="http://www.primefaces.org/primeui/showcase/">
<meta charset="UTF-8">
<title>PrimeUI - Datatable</title>
<link rel="stylesheet" type="text/css" href="themes/bootstrap/theme.css">
<!-- jQuery -->
<script src="resources/js/jquery.js"></script>
<script src="resources/js/jquery-ui.js"></script>
<!-- PrimeUI -->
<link rel="stylesheet" href="../build/primeui.css">
<script src="../build/primeui.js"></script>
<style>
html, body{
margin: 0;
padding: 0;
font-size: 100%;
font: 1em/1.5 Verdana, sans-serif;
}
#main {
max-width: 60em;
margin: auto;
}
h1 {
color: #069;
}
#tbllocal {
width: 50em;
margin: auto;
}
</style>
<script>
$(function() {
var localData = [
{'brand': 'Volkswagen', 'year': 2012, 'color': 'White', 'vin': 'dsad231ff'},
{'brand': 'Audi', 'year': 2011, 'color': 'Black', 'vin': 'gwregre345'},
{'brand': 'Renault', 'year': 2005, 'color': 'Gray', 'vin': 'h354htr'},
{'brand': 'BMW', 'year': 2003, 'color': 'Blue', 'vin': 'j6w54qgh'},
{'brand': 'Mercedes', 'year': 1995, 'color': 'White', 'vin': 'hrtwy34'},
{'brand': 'Volvo', 'year': 2005, 'color': 'Black', 'vin': 'jejtyj'},
{'brand': 'Honda', 'year': 2012, 'color': 'Yellow', 'vin': 'g43gr'},
{'brand': 'Jaguar', 'year': 2013, 'color': 'White', 'vin': 'greg34'},
{'brand': 'Ford', 'year': 2000, 'color': 'Black', 'vin': 'h54hw5'},
{'brand': 'Fiat', 'year': 2013, 'color': 'Red', 'vin': '245t2s'}
];
$('#tbllocal').puidatatable({
caption: 'Local Datasource',
columns: [
{field: 'vin', headerText: 'Vin'},
{field: 'brand', headerText: 'Brand'},
{field: 'year', headerText: 'Year'},
{field: 'color', headerText: 'Color'}
],
datasource: localData
});
});
</script>
</head>
<body>
<div id="main">
<h1>PrimeUI - Datatable</h1>
<div id="tbllocal"></div>
</div>
</body>
</html> |
Partager