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.
12 Ext.form.ComboBoxAdder = function(config){
14 if (typeof(config.listeners.adderclick) != 'undefined') {
15 config.listeners.add = config.listeners.adderclick;
20 Ext.extend(Ext.form.ComboBoxAdder, Ext.form.ComboBox);
24 Ext.form.TextFieldAdder = function(config){
26 Ext.form.TextFieldAdder.superclass.constructor.call(this, config);
27 this.on('select', function(cb, rec, ix) {
28 cb.lastData = rec.data;
35 Ext.extend(Ext.form.TextFieldAdder, Ext.form.TextField, {
37 //onAddClick: function() { },
39 onRender : function(ct, position)
41 Ext.form.TextFieldAdder.superclass.onRender.call(this, ct, position);
42 this.wrap = this.el.wrap({cls: 'x-form-field-wrap'});
43 this.adder = this.wrap.createChild(
44 {tag: 'img', src: Ext.BLANK_IMAGE_URL, cls: 'x-form-textfield-adder'});
46 this.adder.on('click', function(e) {
47 _t.fireEvent('adderclick', this, e);
54 Ext.form.TextFieldAdderMinus = function(config){
56 Ext.form.TextFieldAdder.superclass.constructor.call(this, config);
57 this.on('select', function(cb, rec, ix) {
58 cb.lastData = rec.data;
66 Ext.extend(Ext.form.TextFieldAdderMinus, Ext.form.TextField, {
68 //onAddClick: function() { },
70 onRender : function(ct, position)
72 Ext.form.TextFieldAdder.superclass.onRender.call(this, ct, position);
73 this.wrap = this.el.wrap({cls: 'x-form-field-wrap'});
74 this.adder = this.wrap.createChild(
75 {tag: 'img', src: Ext.BLANK_IMAGE_URL, width: 16, cls: 'x-form-textfield-adder'});
76 this.minus = this.wrap.createChild(
77 {tag: 'img', src: Ext.BLANK_IMAGE_URL, width: 16, cls: 'x-form-textfield-minus'});
79 this.adder.on('click', function(e) {
80 _t.fireEvent('adderclick', this, e);
82 this.minus.on('click', function(e) {
83 _t.fireEvent('minusclick', this, e);