Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ezhov-da/08ee7dcaeede17b552cd92dbd85d243e to your computer and use it in GitHub Desktop.
Save ezhov-da/08ee7dcaeede17b552cd92dbd85d243e to your computer and use it in GitHub Desktop.
создание объектов при определении классов
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