more quote identeiifers fixessss
[Pman.Core] / widgets / FormGrid.js
1 //<script type="text/javascript">
2 /**
3  * @class Ext.form.Checkbox
4  * @extends Ext.form.Field
5  * Single checkbox field.  Can be used as a direct replacement for traditional checkbox fields.
6  * @constructor
7  * Creates a new Checkbox
8  * @param {Object} config Configuration options
9  */
10 Ext.form.FormGrid = function(config){
11     Ext.form.FormGrid.superclass.constructor.call(this, config);
12      
13 };
14
15 Ext.extend(Ext.form.FormGrid, Ext.form.Field,  {
16     /**
17      * @cfg {Number} width  - mostly ignored
18      */
19     width : 100,
20     /**
21      * @cfg {Number} height - used to restrict height of image..
22      */
23     width : 50,
24      /**
25      * @cfg {String} grid The embeded grid...
26      */
27     grid : false, 
28     /**
29      * @cfg {String} focusClass The CSS class to use when the checkbox receives focus (defaults to undefined)
30      */
31     focusClass : undefined,
32     /**
33      * @cfg {String} fieldClass The default CSS class for the checkbox (defaults to "x-form-field")
34      */
35     fieldClass: 'x-form-field',
36     /**
37      * @cfg {Boolean} checked True if the the checkbox should render already checked (defaults to false)
38      */
39     checked: false,
40     /**
41      * @cfg {String/Object} autoCreate A DomHelper element spec, or true for a default element spec (defaults to
42      * {tag: "input", type: "checkbox", autocomplete: "off"})
43      */
44    // defaultAutoCreate : { tag: 'div' },
45      defaultAutoCreate : { tag: 'input', type: 'hidden', autocomplete: 'off'},
46     /**
47      * @cfg {String} addTitle Text to include for adding a title.
48      */
49      addTitle : false,
50     //
51     onResize : function(){
52         Ext.form.Field.superclass.onResize.apply(this, arguments);
53         
54     },
55
56     initEvents : function(){
57         // Ext.form.Checkbox.superclass.initEvents.call(this);
58         // has no events...
59        
60     },
61
62
63     getResizeEl : function(){
64         return this.wrap;
65     },
66
67     getPositionEl : function(){
68         return this.wrap;
69     },
70
71     // private
72     onRender : function(ct, position){
73         
74         this.style = this.style || '';
75         var style = this.style;
76         delete this.style;
77         
78         Ext.form.DisplayImage.superclass.onRender.call(this, ct, position);
79         this.wrap = this.el.wrap({cls: 'x-menu-check-item '}); // not sure why ive done thsi...
80         this.viewEl = this.wrap.createChild({ tag: 'div' });
81         if (style) {
82             this.viewEl.applyStyles(style);
83         }
84         if (this.width) {
85             this.viewEl.setWidth(this.width);
86         }
87         if (this.height) {
88             this.viewEl.setHeight(this.height);
89         }
90         //if(this.inputValue !== undefined){
91         //this.setValue(this.value);
92         
93         
94         this.grid = new Roo.grid.EditorGrid(this.viewEl, this.grid);
95         /*
96         var layout = Roo.BorderLayout.create({
97             center: {
98                 margins:{left:3,top:3,right:3,bottom:3},
99                 panels: [new Roo.GridPanel(grid)]
100             }
101         }, 'grid-panel');
102         */
103
104         this.grid.render();
105
106         
107     },
108
109     // private
110     initValue : Ext.emptyFn,
111
112     /**
113      * Returns the checked state of the checkbox.
114      * @return {Boolean} True if checked, else false
115      */
116     
117     /**
118      * Sets the value of the item. 
119      * @param {Boolean/String} checked True, 'true', '1', or 'on' to check the checkbox, any other value will uncheck it.
120      */
121     setValue : function(v){
122         //this.value = v;
123         
124         Roo.form.FormGrid.superclass.setValue.call(this, v);
125     }
126     
127      
128     
129     
130 });