ip2.declare("Portfolio.entity.history", {

	xtype: 'container',

	require: [
		'Ext.ux.history.view.HistoryView'
	],

	layout: 'fit',

	onInitialize: function(i_widget, i_owner) {

		var i_self = this;

		var i_container = i_owner || i_widget;
		var i_dataParent = i_container.dataParent;

		var token = 0;
		for (var key in i_dataParent.keys) {
			token = i_dataParent.keys[key];
		}

		var filter = [{
			property: "LOGTRNTYP",
			value: i_dataParent.transactiontype
		},{
			property: "LOGENTTKN",
			value: token
		}];

		var i_historyview = Ext.widget('historyview', {
			transactiontype: i_dataParent.transactiontype,
			entity: i_dataParent.entity,
			keys: i_dataParent.keys,
			extraParams: {
				filter: Ext.JSON.encode(filter)
			}
		});
		i_widget.add(i_historyview);
	}
});
