1 /** 2 * @author Gillis Haasnoot <gillis.haasnoot@gmail.com> 3 * @package Banana.Controls 4 * @summary Table 5 */ 6 7 goog.provide('Banana.Controls.DataControls.Table'); 8 9 goog.require('Banana.Controls.DataControls.DataControl'); 10 11 /** @namespace Banana.Controls.Table */ 12 namespace('Banana.Controls').Table = Banana.Controls.DataControl.extend( 13 /** @lends Banana.Controls.Table.prototype */ 14 { 15 16 /** 17 * Creates a table element 18 * @constructs 19 * @extends Banana.Controls.DataControl 20 */ 21 init : function() 22 { 23 this._super(); 24 } 25 }); 26 27 /** 28 * @override 29 * @return {String} 30 */ 31 Banana.Controls.Table.prototype.getTagName = function() 32 { 33 return 'table'; 34 }; 35 36 37 /** @namespace Banana.Controls.TableRow */ 38 namespace('Banana.Controls').TableRow = Banana.Controls.DataControl.extend( 39 /** @lends Banana.Controls.TableRow.prototype */ 40 { 41 /** 42 * Creates a table row also known as the tr element 43 * @constructs 44 * @extends Banana.Controls.DataControl 45 */ 46 init : function() 47 { 48 this._super(); 49 } 50 }); 51 52 /** 53 * @override 54 * @return {String} 55 */ 56 Banana.Controls.TableRow.prototype.getTagName = function() 57 { 58 return 'tr'; 59 }; 60 61 /** @namespace Banana.Controls.TableCol */ 62 namespace('Banana.Controls').TableCol = Banana.Controls.DataControl.extend( 63 /** @lends Banana.Controls.TableCol.prototype */ 64 { 65 /** 66 * Creates a table row also known as the td element 67 * @constructs 68 * @extends Banana.Controls.DataControl 69 */ 70 init : function() 71 { 72 this._super(); 73 } 74 }); 75 76 /** 77 * @override 78 * @return {String} 79 */ 80 Banana.Controls.TableCol.prototype.getTagName = function() 81 { 82 return 'td'; 83 }; 84 85 86 /** @namespace Banana.Controls.TableHeaderCol */ 87 namespace('Banana.Controls').TableHeaderCol = Banana.Controls.TableCol.extend( 88 /** @lends Banana.Controls.TableHeaderCol.prototype */ 89 { 90 /** 91 * Creates a table row also known as the th element 92 * @constructs 93 * @extends Banana.Controls.TableCol 94 */ 95 init : function() 96 { 97 this._super(); 98 } 99 }); 100 101 /** 102 * @override 103 * @return {String} 104 */ 105 Banana.Controls.TableHeaderCol.prototype.getTagName = function() 106 { 107 return 'th'; 108 }; 109 110 111 /** @namespace Banana.Controls.TableHead */ 112 namespace('Banana.Controls').TableHead = Banana.Controls.Panel.extend( 113 /** @lends Banana.Controls.TableHead.prototype */ 114 { 115 /** 116 * Creates a table head 117 * @constructs 118 * @extends Banana.Controls.Panel 119 */ 120 init : function() 121 { 122 this._super(); 123 } 124 }); 125 126 /** 127 * @override 128 * @return {String} 129 */ 130 Banana.Controls.TableHead.prototype.getTagName = function() 131 { 132 return 'thead'; 133 }; 134 135 136 /** @namespace Banana.Controls.TableBody */ 137 namespace('Banana.Controls').TableBody = Banana.Controls.Panel.extend( 138 /** @lends Banana.Controls.TableHead.prototype */ 139 { 140 /** 141 * Creates a table body 142 * @constructs 143 * @extends Banana.Controls.Panel 144 */ 145 init : function() 146 { 147 this._super(); 148 } 149 }); 150 151 /** 152 * @override 153 * @return {String} 154 */ 155 Banana.Controls.TableBody.prototype.getTagName = function() 156 { 157 return 'tbody'; 158 };