Last active
March 10, 2019 12:15
-
-
Save ezhov-da/08ee7dcaeede17b552cd92dbd85d243e to your computer and use it in GitHub Desktop.
создание объектов при определении классов
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Ext.define('Ext.filter.TextField', { | |
extend: 'Ext.panel.Panel', | |
border: false, | |
layout: { | |
type: 'hbox', | |
align: 'stretch', | |
}, | |
padding: 2, | |
config: { | |
emptyText: 'undefine', | |
name: 'undefine', | |
}, | |
constructor: function(config) { | |
this.initConfig(config); | |
this.callParent(config); | |
}, | |
initComponent: function() { | |
this.items = [ | |
{ | |
xtype: 'textfield', | |
name: this.name, | |
emptyText: this.emptyText, | |
}, | |
{ | |
xtype: 'button', | |
iconCls: 'fugue-icon-broom', | |
margin: '0 0 0 2', | |
handler: function() { | |
var panel = this.findParentByType('panel'); | |
panel.clear(); | |
} | |
}, | |
] | |
this.callParent(arguments); | |
}, | |
getValue: function() { | |
return this.items.items[0].getValue(); | |
}, | |
getName: function() { | |
return this.name; | |
}, | |
clear: function() { | |
this.items.items[0].setValue(""); | |
}, | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment