PDA

View Full Version : Unable to use component queries in the Fiddle



mx_starter
28 Dec 2016, 1:10 AM
Is there any reason the component queries not to work in the browser console?

Try this fiddle, open it in the fiddle app, open the console and issue:




Ext.getCmp('fiddleWin')

or

Ext.ComponentQuery.query('window[id=fiddleWin]')[0]



Both wiil return "undefined"

1n9s

mitchellsimoens
28 Dec 2016, 3:02 AM
When you run the code in Fiddle, is the preview the iframe that goes side by side with the editor? If so, when you run those queries in the browser console, you have to target the iframe or else those queries will run against the fiddle app itself, not your running code.

mx_starter
28 Dec 2016, 3:17 AM
When you run the code in Fiddle, is the preview the iframe that goes side by side with the editor? If so, when you run those queries in the browser console, you have to target the iframe or else those queries will run against the fiddle app itself, not your running code.

Yeah, that solves the "issue" :)
55703

mitchellsimoens
28 Dec 2016, 3:40 AM
There is also a user setting that when you run the code it will open a new browser window. When this happens, you do not have to target an iframe and your console code will run against your running code.