/*
 * File: app/controller/GridController.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.controller.GridController', {
	extend: 'Ext.app.Controller',

	refs: [
		{
			ref: 'emptyContainer',
			selector: '#emptyContainer'
		},
		{
			ref: 'gridPanel',
			selector: '#GridPanel'
		},
		{
			ref: 'invoiceDateField',
			selector: '#invoiceDateField'
		},
		{
			ref: 'periodDateField',
			selector: '#periodDateField'
		},
		{
			ref: 'amountField',
			selector: '#amountField'
		},
		{
			ref: 'fileUploadField',
			selector: '#fileUploadField'
		}
	],

	downloadFile: function(FID) {
		console.log(FID);

		var url = "../../service/archive_download.php";

		//var par = Ext.Object.toQueryString(params);
		var par = "id="+FID;
		// Open sapevent in hidden container
		this.getEmptyContainer().update('<iframe src="'+url+"?"+par+'" width="100%" height="100%" frameborder="0" style="border-color: white;" id="hiddenIFrame"></iframe>');

	}

});
