1 /** 2 * @author Gillis Haasnoot <gillis.haasnoot@gmail.com> 3 * @package Banana.Controls 4 * @summary DataGridImageColumn 5 */ 6 7 goog.provide('Banana.Controls.DataControls.ListControls.DataGrid.ColumnControls.DataGridImageColumn'); 8 9 goog.require('Banana.Controls.DataControls.ListControls.DataGrid.ColumnControls.DataGridColumn'); 10 11 /** @namespace Banana.Controls.DataGridImageColumn */ 12 namespace('Banana.Controls').DataGridImageColumn = Banana.Controls.DataGridColumn.extend( 13 /** @lends Banana.Controls.DataGridImageColumn.prototype */ 14 { 15 16 /** 17 * Create datagrid header image for usage in table list renders. 18 * Use set image url to define a image 19 * @constructs 20 * @extends Banana.Controls.DataGridColumn 21 */ 22 init : function() 23 { 24 this._super(); 25 } 26 }); 27 28 /** 29 * @ignore 30 * @return {Banana.UiControl} 31 */ 32 Banana.Controls.DataGridImageColumn.prototype.getControl = function() 33 { 34 this.image = new Banana.Controls.Image(); 35 if (this.imageStyle) 36 { 37 this.image.setStyle(this.imageStyle); 38 } 39 return this.image; 40 }; 41 42 /** 43 * Style the image inside the column 44 * 45 * @param {String} style The style to set 46 * @return {this} 47 */ 48 Banana.Controls.DataGridImageColumn.prototype.setImageStyle = function(style) 49 { 50 this.imageStyle = style; 51 52 if (this.image) 53 { 54 this.image.setStyle(style); 55 } 56 return this; 57 };