diff --git a/index.html b/index.html index 2506c90..7030495 100644 --- a/index.html +++ b/index.html @@ -1,443 +1,444 @@ - - - - -
-
- {_id: "4da96f65dfecf6edd329269c3799de60",
- _rev: "1-3a49c260576c26c758742c8842d5b9ca",
- loadAvgHourlyNI: 8404.7,
- hourEnd: 1,
- loadAvgHourlyDUQ: 1263.2,
- loadAvgHourlyDAY: 1392.2,
- loadAvgHourlyMIDATL: 22126.6,
- loadAvgHourlyDOM: 7162.4,
- loadAvgHourlyAEP: 10855.8,
- loadAvgHourlyAP: 3834.5,
- date: "2010-04-05",
- id: "pjm-20100405-01"}
-
-
- I'll start with using this view:
-
-
- {
- "_id": "_design/tests",
- "_rev": "2-9712dcb1e76a5cc7ab0e0e0b5bf7a70a",
- "language": "javascript",
- "views": {
- "id": {
- "map": "function(doc) {\n emit(doc.id, doc);\n}"
- }
- }
- }
-
-
- So http://69.164.211.38:8080/mydb/_design/tests/_view/id?limit=2
- will give you:
-
- {
- "total_rows":24,
- "offset":0,
- "rows":[
- {
- "id":"4da96f65dfecf6edd329269c3799de60",
- "key":"pjm-20100405-01",
- "value":{"_id":"4da96f65dfecf6edd329269c3799de60","_rev":"1-3a49c260576c26c758742c8842d5b9ca","loadAvgHourlyNI":8404.7,"hourEnd":1,"loadAvgHourlyDUQ":1263.2,"loadAvgHourlyDAY":1392.2,"loadAvgHourlyMIDATL":22126.6,"loadAvgHourlyDOM":7162.4,"loadAvgHourlyAEP":10855.8,"loadAvgHourlyAP":3834.5,"date":"2010-04-05","id":"pjm-20100405-01"}
- },
- {"id":"6339d2c104c222a31872ac400f2a5bb9","key":"pjm-20100405-02","value":{"_id":"6339d2c104c222a31872ac400f2a5bb9","_rev":"1-0e0e84e6485fd61bf830cd01df406393","loadAvgHourlyNI":8011.1,"hourEnd":2,"loadAvgHourlyDUQ":1242.6,"loadAvgHourlyDAY":1347.6,"loadAvgHourlyMIDATL":21215.9,"loadAvgHourlyDOM":6819,"loadAvgHourlyAEP":10485.4,"loadAvgHourlyAP":3808,"date":"2010-04-05","id":"pjm-20100405-02"}}
- ]
- }
-
- - <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript" charset="utf-8"></script> - <script type="text/javascript" src="jquery.couchview.js"></script> --
- - <table id="table-1" bgcolor="gray"> - <tbody> - <tr bgcolor="lightgray"> - <th>Id</th> - <th>Date</th> - <th>Hour</th> - <th>Load</th> - </tr> - <tr bgcolor="white" class="data-row"> - <td>pjm-20100405-24</td> - <td>05/04/2010</td> - <td>24</td> - <td>1686.4</td> - </tr> - </tbody> - </table> -- | ||||||||
-
|
- <html lang="en">
- <head>
- <title>Couch View</title>
- <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
- <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript" charset="utf-8"></script>
- <script type="text/javascript" src="jquery.couchview.js"></script>
- <script>
- $(document).ready(function() {
- $(".grid-test").couchview({
- url: "http://69.164.211.38:8080/mydb/_design/tests/_view/",
- limit: 4,
- view:'id'
- });
- });
- </script>
- </head>
-
- - <table id="table-1" bgcolor="gray" class="grid-test" > --
-<table id="example-1" bgcolor="gray" class="grid-test"> - <tbody class="data-body"> - <tr bgcolor="lightgray" class="header-row"> - <th>Id</th> - <th>Date</th> - <th>Hour</th> - <th>Load</th> - </tr> - <tr bgcolor="white" class="data-row"> - <td class="field" id="id">pjm-20100405-24</td> - <td class="field" id="date">05/04/2010</td> - <td class="field" id="hourEnd" >24</td> - <td class="field" id="loadAvgHourlyDAY">1686.4</td> - </tr> - </tbody> -</table> --
| Id | -Date | -Hour | -Load | -
|---|---|---|---|
| pjm-20100405-24 | -05/04/2010 | -24 | -1686.4 | -
| class | Use |
|---|---|
| pager-first | Creates a clickable element that requests the first page data |
| pager-prev-page | Creates a clickable element that requests the previous page data |
| pager-prev | Creates a clickable element that requests data from the previous record |
| pager-page | The element's inner html is replaced with the current page number |
| pager-page-total | The element's inner html is replaced with the number of pages in total |
| pager-next | Creates a clickable element that requests data from the next record |
| pager-next-page | Creates a clickable element that requests the next page data|
| pager-last | Creates a clickable element that requests the last page data |
-<tr bgcolor="white"> - <th class="pager-first">first</th> - <th class="pager-prev-page">prev</th> - <th class="pager-page">page</th> - <th class="pager-next" >next</th> - <th class="pager-last">last</th> -</tr> -- So we get: -
| Id | -Date | -Hour | -Load | -
|---|---|---|---|
| pjm-20100405-24 | -05/04/2010 | -24 | -1686.4 | -
| prev page | -page | -next | -|
-{
- "_id": "_design/tests",
- "_rev": "7-33b9ed5cb7a82e86d440f83f00cd341e",
- "language": "javascript",
- "views": {
-
- "id": {
- "map": "function(doc) {\n emit(doc.id, doc);\n}"
- },
- "date": {
- "map": "function(doc) {\n emit(doc.date, doc);\n}"
- },
- "hourEnd": {
- "map": "function(doc) {\n emit(doc.hourEnd, doc);\n}"
- },
- "loadAvgHourlyDAY": {
- "map": "function(doc) {\n emit(doc.loadAvgHourlyDAY, doc);\n}"
- }
- }
-}
-
- Now added a 'data-sort' class to the column header elements, in this case the TH tags. Also add an 'id' attribute to each column header setting it to the name of the view.
- - <table id="example-3" bgcolor="gray" class="grid-test"> - <tbody class="data-body"> - <tr bgcolor="lightgray" class="header-row"> - <th id="id" class="data-sort" >Id</th> - <th id="date" class="data-sort" >Date</th> - <th id="hourEnd" class="data-sort" >Hour</th> - <th id="loadAvgHourlyDAY" class="data-sort" >Load</th> - </tr> - <tr bgcolor="white" class="data-row"> - <td class="field" id="id">pjm-20100405-24</td> - <td class="field" id="date">05/04/2010</td> - <td class="field" id="hourEnd" >24</td> - <td class="field" id="loadAvgHourlyDAY">1686.4</td> - </tr> - </tbody> - <tr bgcolor="white"> - <th class="pager-prev-page">prev page</th> - <th class="pager-page">page</th> - <th class="pager-next"colspan="2">next</th> - </tr> - </table> - -- -
| Id | -Date | -Hour | -Load | -
|---|---|---|---|
| pjm-20100405-24 | -05/04/2010 | -24 | -1686.4 | -
| prev page | -page | -next | -|
-<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript" charset="utf-8"></script> -<script type="text/javascript" src="jquery.jeditable.js"></script> -<script type="text/javascript" src="jquery.couchview.js"></script> -- Then added 'edit' to the class of the data columns you want editable. For this example we will make just 'Load' editable. - - -
-<tr bgcolor="white" class="data-row"> - <td class="field" id="id">pjm-20100405-24</td> - <td class="field" id="date">05/04/2010</td> - <td class="field" id="hourEnd" >24</td> - <td class="field edit" id="loadAvgHourlyDAY">1686.4</td> -</tr> -- -
| Id | -Date | -Hour | -Load | -
|---|---|---|---|
| pjm-20100405-24 | -05/04/2010 | -24 | -1686.4 | -
| prev page | -page | -next | -|
| class | Use |
|---|---|
| pager-first | Creates a clickable element that requests the first page data |
| pager-prev-page | Creates a clickable element that requests the previous page data |
| pager-prev | Creates a clickable element that requests data from the previous record |
| pager-page | The element's inner html is replaced with the current page number |
| pager-page-total | The element's inner html is replaced with the number of pages in total |
| pager-next | Creates a clickable element that requests data from the next record |
| pager-next-page | Creates a clickable element that requests the next page data|
| pager-last | Creates a clickable element that requests the last page data |
| class | Use |
|---|---|
| url | Creates a clickable element that requests the first page data |
| limit | Creates a clickable element that requests the previous page data |
| default_view | Creates a clickable element that requests data from the previous record |
+ {_id: "4da96f65dfecf6edd329269c3799de60",
+ _rev: "1-3a49c260576c26c758742c8842d5b9ca",
+ loadAvgHourlyNI: 8404.7,
+ hourEnd: 1,
+ loadAvgHourlyDUQ: 1263.2,
+ loadAvgHourlyDAY: 1392.2,
+ loadAvgHourlyMIDATL: 22126.6,
+ loadAvgHourlyDOM: 7162.4,
+ loadAvgHourlyAEP: 10855.8,
+ loadAvgHourlyAP: 3834.5,
+ date: "2010-04-05",
+ id: "pjm-20100405-01"}
+
+
+ I'll start with using this view:
+
+
+ {
+ "_id": "_design/tests",
+ "_rev": "2-9712dcb1e76a5cc7ab0e0e0b5bf7a70a",
+ "language": "javascript",
+ "views": {
+ "id": {
+ "map": "function(doc) {\n emit(doc.id, doc);\n}"
+ }
+ }
+ }
+
+
+ So http://69.164.211.38:8080/mydb/_design/tests/_view/id?limit=2
+ will give you:
+
+ {
+ "total_rows":24,
+ "offset":0,
+ "rows":[
+ {
+ "id":"4da96f65dfecf6edd329269c3799de60",
+ "key":"pjm-20100405-01",
+ "value":{"_id":"4da96f65dfecf6edd329269c3799de60","_rev":"1-3a49c260576c26c758742c8842d5b9ca","loadAvgHourlyNI":8404.7,"hourEnd":1,"loadAvgHourlyDUQ":1263.2,"loadAvgHourlyDAY":1392.2,"loadAvgHourlyMIDATL":22126.6,"loadAvgHourlyDOM":7162.4,"loadAvgHourlyAEP":10855.8,"loadAvgHourlyAP":3834.5,"date":"2010-04-05","id":"pjm-20100405-01"}
+ },
+ {"id":"6339d2c104c222a31872ac400f2a5bb9","key":"pjm-20100405-02","value":{"_id":"6339d2c104c222a31872ac400f2a5bb9","_rev":"1-0e0e84e6485fd61bf830cd01df406393","loadAvgHourlyNI":8011.1,"hourEnd":2,"loadAvgHourlyDUQ":1242.6,"loadAvgHourlyDAY":1347.6,"loadAvgHourlyMIDATL":21215.9,"loadAvgHourlyDOM":6819,"loadAvgHourlyAEP":10485.4,"loadAvgHourlyAP":3808,"date":"2010-04-05","id":"pjm-20100405-02"}}
+ ]
+ }
+
+ + <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript" charset="utf-8"></script> + <script type="text/javascript" src="jquery.couchview.js"></script> ++
+ + <table id="table-1" bgcolor="gray"> + <tbody> + <tr bgcolor="lightgray"> + <th>Id</th> + <th>Date</th> + <th>Hour</th> + <th>Load</th> + </tr> + <tr bgcolor="white" class="data-row"> + <td>pjm-20100405-24</td> + <td>05/04/2010</td> + <td>24</td> + <td>1686.4</td> + </tr> + </tbody> + </table> ++ | ||||||||
+
|
+ <html lang="en">
+ <head>
+ <title>Couch View</title>
+ <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
+ <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript" charset="utf-8"></script>
+ <script type="text/javascript" src="jquery.couchview.js"></script>
+ <script>
+ $(document).ready(function() {
+ $(".grid-test").couchview({
+ url: "http://69.164.211.38:8080/mydb/_design/tests/_view/",
+ limit: 4,
+ view:'id'
+ });
+ });
+ </script>
+ </head>
+
+ + <table id="table-1" bgcolor="gray" class="grid-test" > ++
+<table id="example-1" bgcolor="gray" class="grid-test"> + <tbody class="data-body"> + <tr bgcolor="lightgray" class="header-row"> + <th>Id</th> + <th>Date</th> + <th>Hour</th> + <th>Load</th> + </tr> + <tr bgcolor="white" class="data-row"> + <td class="field" id="id">pjm-20100405-24</td> + <td class="field" id="date">05/04/2010</td> + <td class="field" id="hourEnd" >24</td> + <td class="field" id="loadAvgHourlyDAY">1686.4</td> + </tr> + </tbody> +</table> ++
| Id | +Date | +Hour | +Load | +
|---|---|---|---|
| pjm-20100405-24 | +05/04/2010 | +24 | +1686.4 | +
| class | Use |
|---|---|
| pager-first | Creates a clickable element that requests the first page data |
| pager-prev-page | Creates a clickable element that requests the previous page data |
| pager-prev | Creates a clickable element that requests data from the previous record |
| pager-page | The element's inner html is replaced with the current page number |
| pager-page-total | The element's inner html is replaced with the number of pages in total |
| pager-next | Creates a clickable element that requests data from the next record |
| pager-next-page | Creates a clickable element that requests the next page data|
| pager-last | Creates a clickable element that requests the last page data |
+<tr bgcolor="white"> + <th class="pager-first">first</th> + <th class="pager-prev-page">prev</th> + <th class="pager-page">page</th> + <th class="pager-next" >next</th> + <th class="pager-last">last</th> +</tr> ++ So we get: +
| Id | +Date | +Hour | +Load | +
|---|---|---|---|
| pjm-20100405-24 | +05/04/2010 | +24 | +1686.4 | +
| prev page | +page | +next | +|
+{
+ "_id": "_design/tests",
+ "_rev": "7-33b9ed5cb7a82e86d440f83f00cd341e",
+ "language": "javascript",
+ "views": {
+
+ "id": {
+ "map": "function(doc) {\n emit(doc.id, doc);\n}"
+ },
+ "date": {
+ "map": "function(doc) {\n emit(doc.date, doc);\n}"
+ },
+ "hourEnd": {
+ "map": "function(doc) {\n emit(doc.hourEnd, doc);\n}"
+ },
+ "loadAvgHourlyDAY": {
+ "map": "function(doc) {\n emit(doc.loadAvgHourlyDAY, doc);\n}"
+ }
+ }
+}
+
+ Now added a 'data-sort' class to the column header elements, in this case the TH tags. Also add an 'id' attribute to each column header setting it to the name of the view.
+ + <table id="example-3" bgcolor="gray" class="grid-test"> + <tbody class="data-body"> + <tr bgcolor="lightgray" class="header-row"> + <th id="id" class="data-sort" >Id</th> + <th id="date" class="data-sort" >Date</th> + <th id="hourEnd" class="data-sort" >Hour</th> + <th id="loadAvgHourlyDAY" class="data-sort" >Load</th> + </tr> + <tr bgcolor="white" class="data-row"> + <td class="field" id="id">pjm-20100405-24</td> + <td class="field" id="date">05/04/2010</td> + <td class="field" id="hourEnd" >24</td> + <td class="field" id="loadAvgHourlyDAY">1686.4</td> + </tr> + </tbody> + <tr bgcolor="white"> + <th class="pager-prev-page">prev page</th> + <th class="pager-page">page</th> + <th class="pager-next"colspan="2">next</th> + </tr> + </table> + ++ +
| Id | +Date | +Hour | +Load | +
|---|---|---|---|
| pjm-20100405-24 | +05/04/2010 | +24 | +1686.4 | +
| prev page | +page | +next | +|
+<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript" charset="utf-8"></script> +<script type="text/javascript" src="jquery.jeditable.js"></script> +<script type="text/javascript" src="jquery.couchview.js"></script> ++ Then added 'edit' to the class of the data columns you want editable. For this example we will make just 'Load' editable. + + +
+<tr bgcolor="white" class="data-row"> + <td class="field" id="id">pjm-20100405-24</td> + <td class="field" id="date">05/04/2010</td> + <td class="field" id="hourEnd" >24</td> + <td class="field edit" id="loadAvgHourlyDAY">1686.4</td> +</tr> ++ +
| Id | +Date | +Hour | +Load | +
|---|---|---|---|
| pjm-20100405-24 | +05/04/2010 | +24 | +1686.4 | +
| prev page | +page | +next | +|
| class | Use |
|---|---|
| pager-first | Creates a clickable element that requests the first page data |
| pager-prev-page | Creates a clickable element that requests the previous page data |
| pager-prev | Creates a clickable element that requests data from the previous record |
| pager-page | The element's inner html is replaced with the current page number |
| pager-page-total | The element's inner html is replaced with the number of pages in total |
| pager-next | Creates a clickable element that requests data from the next record |
| pager-next-page | Creates a clickable element that requests the next page data|
| pager-last | Creates a clickable element that requests the last page data |
| class | Use |
|---|---|
| url | Creates a clickable element that requests the first page data |
| limit | Creates a clickable element that requests the previous page data |
| default_view | Creates a clickable element that requests data from the previous record |