Skip to content

Instantly share code, notes, and snippets.

@moduscreate
Created January 31, 2013 18:39
Show Gist options
  • Select an option

  • Save moduscreate/4685157 to your computer and use it in GitHub Desktop.

Select an option

Save moduscreate/4685157 to your computer and use it in GitHub Desktop.
p = new Ext.Panel({
renderTo : document.body,
itemId : 'mypanel',
height : 200,
width : 500,
frame : true
});
t = new Ext.form.field.Text({fieldLabel : 'meh'});
w = new Ext.Window({
title : 'meh',
border : false,
layout : 'fit',
plain : true,
items : {
xtype : 'form',
items : t
}
});
p.add(w);
w.show()
// Cannot find the textfield directly
console.log(p.query('textfield'));
// We can find the window though
console.log(p.query('window'));
// Can find if we search for window instance, then textfield
console.log(p.query('window')[0].query('textfield'));
// we can go up though:
console.log(t.up('#mypanel'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment