more quote identeiifers fixessss
[Pman.Core] / widgets / ComboBoxAdder.js
1
2 //<script type="text/javascript">
3 /**
4  * 
5  * old combobox adder.. 
6  * this is all incorporated into the new combobox, however the API is different..
7  * 
8  * to make this work on the new combo, you just implement a 'add' handler.
9  */
10
11  
12  
13
14 Ext.form.ComboBoxAdder = function(config){
15     
16     if (typeof(config.listeners.adderclick) != 'undefined') {
17         config.listeners.add = config.listeners.adderclick;
18     }
19    Ext.form.ComboBoxAdder.superclass.constructor.call(this, config);  
20 }
21  
22 Ext.extend(Ext.form.ComboBoxAdder, Ext.form.ComboBox);
23
24
25
26 Ext.form.TextFieldAdder = function(config){
27     
28     Ext.form.TextFieldAdder.superclass.constructor.call(this, config);
29     this.on('select', function(cb, rec, ix) {
30         cb.lastData = rec.data;
31     });
32     this.addEvents({
33         'adderclick' : true
34     });
35 }
36  
37 Ext.extend(Ext.form.TextFieldAdder, Ext.form.TextField, { 
38     lastData : false,
39     //onAddClick: function() { },
40     
41     onRender : function(ct, position) 
42     {
43         Ext.form.TextFieldAdder.superclass.onRender.call(this, ct, position); 
44          this.wrap = this.el.wrap({cls: 'x-form-field-wrap'});
45         this.adder = this.wrap.createChild(
46             {tag: 'img', src: Ext.BLANK_IMAGE_URL, cls: 'x-form-textfield-adder'});  
47         var _t = this;
48         this.adder.on('click', function(e) {
49             _t.fireEvent('adderclick', this, e);
50         }, _t);
51     }
52     
53 });
54
55
56 Ext.form.TextFieldAdderMinus = function(config){
57     
58     Ext.form.TextFieldAdder.superclass.constructor.call(this, config);
59     this.on('select', function(cb, rec, ix) {
60         cb.lastData = rec.data;
61     });
62     this.addEvents({
63         'adderclick' : true,
64         'minusclick' : true
65     });
66 }
67  
68 Ext.extend(Ext.form.TextFieldAdderMinus, Ext.form.TextField, { 
69     lastData : false,
70     //onAddClick: function() { },
71     
72     onRender : function(ct, position) 
73     {
74         Ext.form.TextFieldAdder.superclass.onRender.call(this, ct, position); 
75          this.wrap = this.el.wrap({cls: 'x-form-field-wrap'});
76         this.adder = this.wrap.createChild(
77             {tag: 'img', src: Ext.BLANK_IMAGE_URL, width: 16, cls: 'x-form-textfield-adder'});  
78         this.minus = this.wrap.createChild(
79             {tag: 'img', src: Ext.BLANK_IMAGE_URL, width: 16, cls: 'x-form-textfield-minus'});  
80         var _t = this;
81         this.adder.on('click', function(e) {
82             _t.fireEvent('adderclick', this, e);
83         }, _t);
84         this.minus.on('click', function(e) {
85             _t.fireEvent('minusclick', this, e);
86         }, _t);
87     }
88     
89 });
90