
Ext.define('Ext.ux.call2action.Field', {

	extend: 'Ext.form.FieldContainer',

	alias: ['widget.call2actionfield'],

	mixins: {
		field: 'Ext.form.field.Field'
	},

	grid: null,

	initComponent: function () {

		var i_cmp = this;

		i_cmp.callParent(arguments);

		i_cmp.initField();

		i_cmp.grid = i_cmp.add({
			xtype: 'ip2Call2ActionGridGrid',
			data: [],
			wrapper: i_cmp
		});

		return i_cmp;
	},

	initValue: function () {

		var i_cmp = this;
		var a_value = i_cmp.getValue();

		i_cmp.value = a_value;

		i_cmp.mixins.field.initValue.call(i_cmp);
	},

	getValue: function () {

		var i_cmp = this;
		var a_value = i_cmp.value;

		if (i_cmp.grid) {
			a_value = i_grid.getValue();
		}

		return a_value;
	},

	setValue: function (value) {

		var i_cmp = this;
		var i_grid = i_cmp.grid;
		var a_value;

		return i_cmp.mixins.field.setValue.call(i_cmp.value);
	},

	isDirty: function () {
	}
});
