/*
 * File: app/view/Restriction.js
 *
 * This file was generated by Sencha Architect version 3.0.2.
 * http://www.sencha.com/products/architect/
 *
 * This file requires use of the Ext JS 4.2.x library, under independent license.
 * License of Sencha Architect does not include license for Ext JS 4.2.x. For more
 * details see http://www.sencha.com/license or contact license@sencha.com.
 *
 * This file will be auto-generated each and everytime you save your project.
 *
 * Do NOT hand edit this file.
 */

Ext.define('MyApp.view.Restriction', {
	extend: 'Ext.window.Window',
	alias: 'widget.Restriction',

	requires: [
		'Ext.form.Panel',
		'Ext.form.field.ComboBox',
		'Ext.form.Label',
		'Ext.toolbar.Spacer',
		'Ext.button.Button'
	],

	itemId: 'Restriction',
	width: 600,
	layout: 'fit',
	title: 'Create restriction',
	modal: true,

	initComponent: function() {
		var me = this;

		Ext.applyIf(me, {
			items: [
				{
					xtype: 'form',
					itemId: 'restrictionForm',
					bodyPadding: 5,
					header: false,
					layout: {
						type: 'vbox',
						align: 'stretch'
					},
					items: [
						{
							xtype: 'container',
							flex: 1,
							margins: '0 0 5 0',
							layout: {
								type: 'hbox',
								align: 'stretch'
							},
							items: [
								{
									xtype: 'combobox',
									flex: 1,
									itemId: 'fieldScope',
									fieldLabel: 'Scope',
									labelSeparator: ' ',
									labelWidth: 75,
									name: 'scope',
									allowBlank: false,
									allowOnlyWhitespace: false,
									editable: false,
									anyMatch: true,
									forceSelection: true,
									queryMode: 'local',
									store: 'Scopes',
									valueField: 'id'
								},
								{
									xtype: 'label',
									flex: 0.75,
									itemId: 'fieldScopeLabel',
									padding: '3 10 0 10',
									text: 'My Label'
								}
							]
						},
						{
							xtype: 'container',
							flex: 1,
							margins: '0 0 5 0',
							layout: {
								type: 'hbox',
								align: 'stretch'
							},
							items: [
								{
									xtype: 'combobox',
									flex: 1,
									itemId: 'typeCombo',
									fieldLabel: 'Type',
									labelSeparator: ' ',
									labelWidth: 75,
									name: 'type',
									allowBlank: false,
									allowOnlyWhitespace: false,
									editable: false,
									anyMatch: true,
									forceSelection: true,
									queryMode: 'local',
									store: 'RestrictionTypes',
									valueField: 'id'
								},
								{
									xtype: 'tbspacer',
									flex: 0.75
								}
							]
						},
						{
							xtype: 'combobox',
							flex: 1,
							itemId: 'fieldField',
							fieldLabel: 'Field',
							labelSeparator: ' ',
							labelWidth: 75,
							name: 'field',
							allowBlank: false,
							allowOnlyWhitespace: false,
							anyMatch: true,
							forceSelection: true,
							queryMode: 'local',
							store: 'Fields',
							valueField: 'id'
						},
						{
							xtype: 'textfield',
							flex: 1,
							itemId: 'fieldLow',
							fieldLabel: 'Low',
							labelSeparator: ' ',
							labelWidth: 75,
							name: 'low',
							allowBlank: false,
							allowOnlyWhitespace: false,
							enforceMaxLength: true,
							maxLength: 40
						},
						{
							xtype: 'textfield',
							flex: 1,
							itemId: 'fieldHigh',
							fieldLabel: 'High',
							labelSeparator: ' ',
							labelWidth: 75,
							name: 'high',
							enforceMaxLength: true,
							maxLength: 40
						},
						{
							xtype: 'textfield',
							flex: 1,
							fieldLabel: 'Comment',
							labelSeparator: ' ',
							labelWidth: 75,
							name: 'comment'
						},
						{
							xtype: 'container',
							flex: 1,
							layout: {
								type: 'hbox',
								align: 'stretch'
							},
							items: [
								{
									xtype: 'tbspacer',
									flex: 1
								},
								{
									xtype: 'button',
									itemId: 'btnSave',
									padding: 5,
									icon: '../gfx/save.png',
									scale: 'medium',
									text: 'Save'
								}
							]
						}
					]
				},
				{
					xtype: 'container',
					hidden: true,
					itemId: 'emptyContainer'
				}
			]
		});

		me.callParent(arguments);
	}

});