Extended Javascript - begginer

hi experts
I have this code

var submitHandler = function() {
	var ownrPnl = this.up('panel')[0], 
		tf      = this.ownerCt.query('#queryEditor')[0],
		query   = tf.getRawValue(),
		items;
		
	if (query.length < 1) {
		Ext.MessageBox.alert(
			'Error!', 
			'The query editor cannot be left blank!',
		 	function() {
				tf.el.frame('#F00');
				tf.focus();
			}
		);
		return;
	}	
	else {
		items = Ext.ComponentQuery.query(query);
	}	
		
	if (items.length < 1) {
		if (console.warn) {
			console.warn('No items found using:', query);
		}
	}
	else {
		if (console.info) {
			console.info('found ' + query.length + ' items using query: ', query);
		}
		Ext.each(items, function(item) {
			if (console.log) {
				console.log(item);
			}
			item.rendered &&  item.el.fadeOut().fadeIn();
			
		});
	}
};

var bottomToolbar = {
	xtype : 'toolbar',
	dock  : 'bottom',
	items : [
		'Ext.ComponentQuery.query(\'',
		{
			xtype  : 'textfield',
			itemId : 'queryEditor',
			flex   : 1
		},
		'\');',
		'->',
		{
			text    : 'Submit query',
			handler : submitHandler
		}
	]
	
};

Open in new window


I want to know what this code means
var ownrPnl = this.up('panel')[0],
            tf      = this.ownerCt.query('#queryEditor')[0],
            query   = tf.getRawValue(),
            items;
what is ownerCt ? and what is tf.el.frame('#F00'); ?
thanks
royjaydAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Ivo StoykovCommented:
Hi

This is extJS library
> what is ownerCt ?
ownerCt : Ext.Container
This Component's owner Container (defaults to undefined, and is set automatically when this Component is added to a Container). Read-only.

> var ownrPnl = this.up('panel')[0],
Every component has an ownerCt property reference which is the Container or Component that holds the current Component. What the doc is saying is that .up() goes from ownerCt to ownerCt until 1) it finds a component that matches the parameter you passed, or 2) it gets to the topmost component in the hierarchy.

>tf      = this.ownerCt.query('#queryEditor')[0],
returns item with id=queryEditor - a EditorGrid Panel
> query   = tf.getRawValue(),

getRawValue( ) : String

Returns the raw String value of the field, without performing any normalization, conversion, or validation. Gets the current value of the input element if the field has been rendered, ignoring the value if it is the emptyText.

>and what is tf.el.frame('#F00');
this should be animation

generally it is a good idea to observe documentation

HTH
Ivo Stoykov
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
royjaydAuthor Commented:
Thanks,
any help with my next question will be greatly appreciated.
http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28510041.html

Thanks very much in advance.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JavaScript

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.