Extended Javascript  - begginer

Posted on 2014-08-27
Last Modified: 2014-09-02
hi experts
I have this code

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

var bottomToolbar = {
	xtype : 'toolbar',
	dock  : 'bottom',
	items : [
			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(),
what is ownerCt ? and what is tf.el.frame('#F00'); ?
Question by:royjayd
    LVL 22

    Accepted Solution


    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

    Ivo Stoykov

    Author Comment

    any help with my next question will be greatly appreciated.

    Thanks very much in advance.

    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    Join & Write a Comment

    This article shows how to read a single webpage's HTML into a string variable, and it also shows how to automate a sequence so you can read and process a list of webpages.  I was tasked with reading and parsing a series of webpages to collect some s…
    In Part 1 ( we covered the hexagonal maze basics -- how the cells are represented in a JavaScript array and how the maze is displayed.  In this part, we'…
    The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
    The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now