﻿Ext.override(Ext.form.Field, {
	/**
	* Show the container including the label
	*/
	showContainer: function ()
	{
		this.enable();
		this.show();

		if (!Ext.isEmpty(this.getEl()))
		{
			this.getEl().up('.x-form-item').setDisplayed(true); // show entire container and children (including label if applicable)
		}


	},

	/**
	* Hide the container including the label
	*/
	hideContainer: function ()
	{
		this.disable(); // for validation
		this.hide();

		if (!Ext.isEmpty(this.getEl()))
		{
			this.getEl().up('.x-form-item').setDisplayed(false); // hide container and children (including label if applicable)
		}
	},

	/**
	* Hide / Show the container including the label
	* @param visible
	*/
	setContainerVisible: function (visible)
	{
		if (this.rendered)
		{
			if (visible)
			{
				this.showContainer();
			} else
			{
				this.hideContainer();
			}
		}

		return this;
	}

}); 
