2 //<script type="text/javascript">
6 * this is all incorporated into the new combobox, however the API is different..
8 * to make this work on the new combo, you just implement a 'add' handler.
15 Ext.form.ComboBoxAdder = function(config){
17 if (typeof(config.listeners.adderclick) != 'undefined') {
18 config.listeners.add = config.listeners.adderclick;
23 Ext.extend(Ext.form.ComboBoxAdder, Ext.form.ComboBox);
27 Ext.form.TextFieldAdder = function(config){
29 Ext.form.TextFieldAdder.superclass.constructor.call(this, config);
30 this.on('select', function(cb, rec, ix) {
31 cb.lastData = rec.data;
38 Ext.extend(Ext.form.TextFieldAdder, Ext.form.TextField, {
40 //onAddClick: function() { },
42 onRender : function(ct, position)
44 Ext.form.TextFieldAdder.superclass.onRender.call(this, ct, position);
45 this.wrap = this.el.wrap({cls: 'x-form-field-wrap'});
46 this.adder = this.wrap.createChild(
47 {tag: 'img', src: Ext.BLANK_IMAGE_URL, cls: 'x-form-textfield-adder'});
49 this.adder.on('click', function(e) {
50 _t.fireEvent('adderclick', this, e);
57 Ext.form.TextFieldAdderMinus = function(config){
59 Ext.form.TextFieldAdder.superclass.constructor.call(this, config);
60 this.on('select', function(cb, rec, ix) {
61 cb.lastData = rec.data;
69 Ext.extend(Ext.form.TextFieldAdderMinus, Ext.form.TextField, {
71 //onAddClick: function() { },
73 onRender : function(ct, position)
75 Ext.form.TextFieldAdder.superclass.onRender.call(this, ct, position);
76 this.wrap = this.el.wrap({cls: 'x-form-field-wrap'});
77 this.adder = this.wrap.createChild(
78 {tag: 'img', src: Ext.BLANK_IMAGE_URL, width: 16, cls: 'x-form-textfield-adder'});
79 this.minus = this.wrap.createChild(
80 {tag: 'img', src: Ext.BLANK_IMAGE_URL, width: 16, cls: 'x-form-textfield-minus'});
82 this.adder.on('click', function(e) {
83 _t.fireEvent('adderclick', this, e);
85 this.minus.on('click', function(e) {
86 _t.fireEvent('minusclick', this, e);