/*
 * File: app/view/addRoleToRuleWindowClass.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.addRoleToRuleWindowClass', {
	extend: 'Ext.window.Window',
	alias: 'widget.addRoleToRuleWindowAlias',

	requires: [
		'Ext.toolbar.Toolbar',
		'Ext.form.field.Trigger',
		'Ext.toolbar.Spacer',
		'Ext.tree.Panel',
		'Ext.tree.View',
		'Ext.tree.Column',
		'Ext.selection.CheckboxModel',
		'Ext.button.Button'
	],

	itemId: 'addRoleToRuleWindow',
	width: 596,
	bodyPadding: 10,
	closable: false,
	icon: '../gfx/role_composite.png',
	title: 'Add roles',
	modal: true,

	layout: {
		type: 'vbox',
		align: 'stretch'
	},

	initComponent: function() {
		var me = this;

		Ext.applyIf(me, {
			items: [
				{
					xtype: 'container',
					flex: 1,
					layout: {
						type: 'vbox',
						align: 'stretch'
					},
					items: [
						{
							xtype: 'toolbar',
							border: false,
							items: [
								{
									xtype: 'triggerfield',
									flex: 1,
									itemId: 'addToRuleSearchField',
									fieldLabel: 'Role search ',
									labelAlign: 'right',
									labelSeparator: ' ',
									labelWidth: 70,
									triggerCls: 'x-form-search-trigger'
								},
								{
									xtype: 'tbspacer'
								},
								{
									xtype: 'tbspacer'
								}
							]
						},
						{
							xtype: 'tbspacer',
							height: 10
						},
						{
							xtype: 'treepanel',
							flex: 1,
							height: 350,
							itemId: 'addRoleToRuleTreePanel',
							width: 600,
							header: false,
							title: 'My Tree Grid Panel',
							allowDeselect: true,
							hideHeaders: false,
							store: 'AddRoleToRuleTreeStore',
							viewConfig: {
								itemId: 'addRoleToRiskView',
								loadMask: true,
								rootVisible: false
							},
							columns: [
								{
									xtype: 'treecolumn',
									dataIndex: 'technicalname',
									text: 'Role',
									flex: 3
								},
								{
									xtype: 'gridcolumn',
									dataIndex: 'rolename',
									text: 'Description',
									flex: 3
								},
								{
									xtype: 'gridcolumn',
									align: 'right',
									dataIndex: 'derivatives',
									text: 'Derived roles'
								}
							],
							selModel: Ext.create('Ext.selection.CheckboxModel', {
								toggleOnClick: false,
								checkOnly: true
							})
						}
					]
				},
				{
					xtype: 'tbspacer',
					height: 10
				},
				{
					xtype: 'container',
					layout: {
						type: 'hbox',
						align: 'stretch'
					},
					items: [
						{
							xtype: 'button',
							disabled: true,
							itemId: 'addToRuleAddButton',
							padding: '5 10 5 10',
							icon: '../gfx/add.png',
							scale: 'medium',
							text: 'Add selected roles'
						},
						{
							xtype: 'tbspacer',
							flex: 1
						},
						{
							xtype: 'button',
							disabled: true,
							itemId: 'addToRuleClearButton',
							padding: '5 10 5 10',
							icon: '../gfx/clear.png',
							scale: 'medium',
							text: 'Clear selection'
						},
						{
							xtype: 'tbspacer',
							flex: 1
						},
						{
							xtype: 'button',
							itemId: 'addToRuleCancelButton',
							padding: '5 10 5 10',
							icon: '../gfx/done.png',
							scale: 'medium',
							text: 'Done'
						}
					]
				}
			]
		});

		me.callParent(arguments);
	}

});