How to add button to each form field?

Posted By Vitaliy | August 15, 2012 | ExtJS 4.1.0
0 3218
Reply to thread

Js Code

var fieldcontainer = Ext.widget({
	xtype: 'fieldcontainer',
	layout: 'hbox'
});

var field = Ext.widget(item);

fieldcontainer.add(field);
fieldcontainer.add(Ext.widget({
	xtype: 'splitter'
}));
var clearer = Ext.widget({
	xtype: 'button',
	field: field,
	disabled: field.disabled,
	handler: function () { this.field.reset(); }
});
fieldcontainer.add(clearer);
            

Filter Window For Grid

Posted By Vitaliy | March 24, 2012 | ExtJS 4.0.7
0 2303
Reply to thread

Js Code

Ext.define('App.view.BooksFilter', {
	extend: 'Ext.window.Window',
	alias: 'widget.booksfilter',
	title: 'Books Filter',
	width: 350,
	layout: 'fit',
	resizable: false,
	closeAction: 'hide',
	modal: true,
	items: [
		{
			xtype: 'form',
			layout: 'anchor',
			bodyStyle: {
				background: 'none',
				padding: '10px',
				border: '0'
			},
			defaults: {
				xtype: 'textfield',
				anchor: '100%'
			},
			items: [
				{
					name: 'title',
					fieldLabel: 'Title'
				},
				{
					name: 'author',
					fieldLabel: 'Author'
				}
			]
		}
	],
	buttons: [
		{
			text: 'OK',
			action: 'filter'
		},
		{
			text: 'Reset',
			handler: function () { this.up('window').down('form').getForm().reset(); }
		},
		{
			text: 'Cancel',
			handler: function () { this.up('window').close(); }
		}
	]
});