drilldownrow.html 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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. Use of this source code is governed by the Apache License, Version 2.0.
  7. See the COPYING file for details.
  8. -->
  9. <head>
  10. <title>Demo of DrilldownRow</title>
  11. <script type="text/javascript" src="../base.js"></script>
  12. <script>
  13. goog.require('goog.dom');
  14. goog.require('goog.ui.DrilldownRow');
  15. </script>
  16. <style type="text/css">
  17. .toggle {
  18. cursor: pointer;
  19. cursor: hand;
  20. background-repeat: none;
  21. background-position: right;
  22. }
  23. tr.goog-drilldown-expanded .toggle {
  24. background-image: url('../images/minus.png');
  25. }
  26. tr.goog-drilldown-collapsed .toggle {
  27. background-image: url('../images/plus.png');
  28. }
  29. tr.goog-drilldown-hover td {
  30. background-color: #CCCCFF;
  31. }
  32. td {
  33. background-color: white;
  34. }
  35. </style>
  36. </head>
  37. <body>
  38. <table id=table style="background-color: silver">
  39. <tr>
  40. <th>Column Head</th>
  41. <th>Second Head</th>
  42. </tr>
  43. <tr id=firstRow>
  44. <td>First row</td>
  45. <td>Second column</td>
  46. </tr>
  47. </table>
  48. </body>
  49. <script type="text/javascript">
  50. var ff = goog.dom.getElement('firstRow');
  51. var d = new goog.ui.DrilldownRow({});
  52. var d1 = new goog.ui.DrilldownRow(
  53. {html: '<tr><td>Second row</td><td>Second column</td></tr>'}
  54. );
  55. var d2 = new goog.ui.DrilldownRow(
  56. {html: '<tr><td>Third row</td><td>Second column</td></tr>'}
  57. );
  58. var d21 = new goog.ui.DrilldownRow(
  59. {html: '<tr><td>Fourth row</td><td>Second column</td></tr>'}
  60. );
  61. var d22 = new goog.ui.DrilldownRow(goog.ui.DrilldownRow.sampleProperties);
  62. d.decorate(ff);
  63. d.addChild(d1, true);
  64. d.addChild(d2, true);
  65. d2.addChild(d21, true);
  66. d2.addChild(d22, true);
  67. </script>
  68. </html>