//radioCol = new Ext.grid.RadioColumn({header: 'Assign', dataIndex: 'assign'});
var calendarEventRejectionPopup = new Ext.Window({
	layout: 'fit',
	id: 'calendarEventRejectionPopup',
	title: 'Reject Event',
	width: 340,
	height: 250,
	closeAction: 'hide',
	border: false,
	modal: true,
	tools: [{
		id: 'help'
	}],
	items: [{
		xtype: 'form',
		bodyStyle: 'background-color: #ced9e7; padding: 10px',
		border: false,
		//defaults: {style: {paddingLeft: 50}},
		items: [{
			html: '<div style= "height: 100%; background-color: #ced9e7"><img src="ext/resources/images/default/window/icon-error.gif" /></div>',
			width: 50,
			cls: 'floatLeft',
			border: false
		},
		{
			xtype: 'label',
			text: 'You are about to reject this event request.'
		},
		{
			xtype: 'checkbox',
			boxLabel: 'Delete request upon rejection.',
			hideLabel: true,
			name: 'doDelete',
			style: {
				marginLeft: '12px'
			}
		},
		{
			xtype: 'fieldset',
			title: 'Send a notification message',
			anchor: 'none -20',
			checkboxToggle: true,
			layout: 'fit',
			items: [{
				xtype: 'textarea',
				name: 'message'
			}]
		}]
	}],
	buttons: [{
		text: 'OK',
		handler: function(btn) {
			approvalGrid = calendarEventApprovalPopup.items.items[0].items.items[0].items.items[0];
			selections = approvalGrid.getSelectionModel().getSelections();
			eventIDs = [];
			for (i = 0; i < selections.length; i++) {
				eventIDs.push(selections[i].data.itemno);
			}
			this.ownerCt.ownerCt.items.items[0].getForm().submit({
				url: 'main_menu/calendar_data.json.php',
				params: {
					command: 'rejectEvents',
					eventIDs: Ext.encode(eventIDs)
				},
				success: function(form, obj) {
					approvalGrid.store.load();
				},
				failure: function() {
					Ext.Msg.alert('ERROR', 'Failure: Event(s) failed to be rejected');
				}
			});
			this.ownerCt.ownerCt.hide();
		}
	},
	{
		text: 'Cancel',
		handler: function(btn) {
			this.ownerCt.ownerCt.hide();
		}
	}]
});

