| 1 |
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" |
| 2 |
"http://www.w3.org/TR/html4/loose.dtd"> |
| 3 |
<html> |
| 4 |
<!-- |
| 5 |
Copyright 2010 The Closure Library Authors. All Rights Reserved. |
| 6 |
|
| 7 |
Use of this source code is governed by the Apache License, Version 2.0. |
| 8 |
See the COPYING file for details. |
| 9 |
--> |
| 10 |
<head> |
| 11 |
<title>Demo of DrilldownRow</title> |
| 12 |
<script type="text/javascript" src="../base.js"></script> |
| 13 |
<script> |
| 14 |
goog.require('goog.dom'); |
| 15 |
goog.require('goog.ui.DrilldownRow'); |
| 16 |
</script> |
| 17 |
|
| 18 |
<style type="text/css"> |
| 19 |
|
| 20 |
.toggle { |
| 21 |
cursor: pointer; |
| 22 |
cursor: hand; |
| 23 |
background-repeat: none; |
| 24 |
background-position: right; |
| 25 |
} |
| 26 |
|
| 27 |
tr.goog-drilldown-expanded .toggle { |
| 28 |
background-image: url('../images/minus.png'); |
| 29 |
} |
| 30 |
|
| 31 |
tr.goog-drilldown-collapsed .toggle { |
| 32 |
background-image: url('../images/plus.png'); |
| 33 |
} |
| 34 |
|
| 35 |
tr.goog-drilldown-hover td { |
| 36 |
background-color: #CCCCFF; |
| 37 |
} |
| 38 |
|
| 39 |
td { |
| 40 |
background-color: white; |
| 41 |
} |
| 42 |
|
| 43 |
</style> |
| 44 |
</head> |
| 45 |
|
| 46 |
<body> |
| 47 |
<table id=table style="background-color: silver"> |
| 48 |
<tr> |
| 49 |
<th>Column Head</th> |
| 50 |
<th>Second Head</th> |
| 51 |
</tr> |
| 52 |
<tr id=firstRow> |
| 53 |
<td>First row</td> |
| 54 |
<td>Second column</td> |
| 55 |
</tr> |
| 56 |
</table> |
| 57 |
</body> |
| 58 |
|
| 59 |
<script type="text/javascript"> |
| 60 |
var ff = goog.dom.getElement('firstRow'); |
| 61 |
var d = new goog.ui.DrilldownRow({}); |
| 62 |
var d1 = new goog.ui.DrilldownRow( |
| 63 |
{html: '<tr><td>Second row</td><td>Second column</td></tr>'} |
| 64 |
); |
| 65 |
var d2 = new goog.ui.DrilldownRow( |
| 66 |
{html: '<tr><td>Third row</td><td>Second column</td></tr>'} |
| 67 |
); |
| 68 |
var d21 = new goog.ui.DrilldownRow( |
| 69 |
{html: '<tr><td>Fourth row</td><td>Second column</td></tr>'} |
| 70 |
); |
| 71 |
var d22 = new goog.ui.DrilldownRow(goog.ui.DrilldownRow.sampleProperties); |
| 72 |
d.decorate(ff); |
| 73 |
d.addChild(d1, true); |
| 74 |
d.addChild(d2, true); |
| 75 |
d2.addChild(d21, true); |
| 76 |
d2.addChild(d22, true); |
| 77 |
</script> |
| 78 |
</html> |