|
| 1 | +<!DOCTYPE HTML> |
| 2 | +<html> |
| 3 | +<head> |
| 4 | + <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> |
| 5 | + <title>SlickGrid example: Two Basic grids on page</title> |
| 6 | + <link rel="stylesheet" href="../slick.grid.css" type="text/css"/> |
| 7 | + <link rel="stylesheet" href="../css/smoothness/jquery-ui-1.11.3.custom.css" type="text/css"/> |
| 8 | + <link rel="stylesheet" href="examples.css" type="text/css"/> |
| 9 | + <style> |
| 10 | + #myGrid01, #myGrid02 { |
| 11 | + background: white; |
| 12 | + outline: 0; |
| 13 | + border: 1px solid gray; |
| 14 | + } |
| 15 | + </style> |
| 16 | +</head> |
| 17 | +<body> |
| 18 | +<table width="100%"> |
| 19 | + <tr> |
| 20 | + <td valign="top" width="50%"> |
| 21 | + <div id="myGrid02" style="width:600px;height:300px;"></div> |
| 22 | + <br/> |
| 23 | + <div id="myGrid01" style="width:600px;height:300px;"></div> |
| 24 | + </td> |
| 25 | + <td valign="top"> |
| 26 | + <h2>Demonstrates:</h2> |
| 27 | + <ul> |
| 28 | + <li>two basic grids with minimal configuration</li> |
| 29 | + </ul> |
| 30 | + <h2>View Source:</h2> |
| 31 | + <ul> |
| 32 | + <li><A href="https://github.com/mleibman/SlickGrid/blob/gh-pages/examples/example1-simple.html" target="_sourcewindow"> View the source for this example on Github</a></li> |
| 33 | + </ul> |
| 34 | + </td> |
| 35 | + </tr> |
| 36 | +</table> |
| 37 | + |
| 38 | +<script src="../lib/jquery-1.11.2.min.js"></script> |
| 39 | +<script src="../lib/jquery.event.drag-2.2.js"></script> |
| 40 | + |
| 41 | +<script src="../slick.core.js"></script> |
| 42 | +<script src="../slick.grid.js"></script> |
| 43 | + |
| 44 | +<script> |
| 45 | + var grid; |
| 46 | + var columns = [ |
| 47 | + {id: "title", name: "Title", field: "title"}, |
| 48 | + {id: "duration", name: "Duration", field: "duration"}, |
| 49 | + {id: "%", name: "% Complete", field: "percentComplete"}, |
| 50 | + {id: "start", name: "Start", field: "start"}, |
| 51 | + {id: "finish", name: "Finish", field: "finish"}, |
| 52 | + {id: "effort-driven", name: "Effort Driven", field: "effortDriven"} |
| 53 | + ]; |
| 54 | + |
| 55 | + var options = { |
| 56 | + enableCellNavigation: true, |
| 57 | + enableColumnReorder: false |
| 58 | + }; |
| 59 | + |
| 60 | + function CreateData() { |
| 61 | + var data = []; |
| 62 | + for (var i = 0; i < 500; i++) { |
| 63 | + data[i] = { |
| 64 | + title: "Task " + i, |
| 65 | + duration: "5 days", |
| 66 | + percentComplete: Math.round(Math.random() * 100), |
| 67 | + start: "01/01/2009", |
| 68 | + finish: "01/05/2009", |
| 69 | + effortDriven: (i % 5 == 0) |
| 70 | + }; |
| 71 | + } |
| 72 | + return data; |
| 73 | + } |
| 74 | + |
| 75 | + $(function () { |
| 76 | + var data01 = CreateData(); |
| 77 | + grid01 = new Slick.Grid("#myGrid01", data01, columns, options); |
| 78 | + |
| 79 | + var data02 = CreateData(); |
| 80 | + grid02 = new Slick.Grid("#myGrid02", data02, columns, options); |
| 81 | + }) |
| 82 | +</script> |
| 83 | +</body> |
| 84 | +</html> |
0 commit comments