Permalink
Browse files

add more example content

  • Loading branch information...
1 parent 31aadf3 commit 6bcdd67cf5eb197e7061b7003904497dbea7d7a6 @kflorence committed Oct 13, 2010
Showing with 32 additions and 13 deletions.
  1. +32 −13 index.html
View
@@ -11,35 +11,54 @@
<script type="text/javascript">
jQuery(function($) {
- $("#tabulate").tabulate({
+ $("#tabulate-ajax").tabulate({
data: {
source: {
ajax: {
url: "data.php",
dataType: "json"
}
}
+ }
+ });
+
+ $("#tabulate-json").tabulate({
+ data: {
+ source: {
+ json: {
+ "head": [
+ ["heading 1", "heading 2", "heading 3"]
+ ],
+ "body": [
+ ["column 1", "column 2", "column 3"],
+ ["column 1", "column 2", "column 3"]
+ ]
+ }
+ }
},
table: {
- body: {
- columns: {
- "col1": {
- content: "{col1}",
- events: {
- "click": function(event, $cell, $content, data) {
- console.log("click", event, $cell, $content, data);
- }
- }
- }
- }
+ body: {
+ rows: {
+ 0: {
+ filter: function($row, $content, data) {
+ $row.css("background-color", "#EEEEEE");
+ }
+ }
+ }
}
}
});
});
</script>
</head>
<body>
+ <h1>jQuery.tabulate</h1>
<p><a href="doc/" class="api">Documentation</a></p>
- <div id="tabulate"></div>
+
+ <h2>Tabulate via AJAX request</h2>
+ <div id="tabulate-ajax"></div>
+
+ <h2>Tabulate via static JSON</h2>
+ <div id="tabulate-json"></div>
</body>
</html>

0 comments on commit 6bcdd67

Please sign in to comment.