extjs4 - Difference between Ext.widget() and Ext.ComponentQuery.query()? -


i have component created extends ext.window.window, i've given alias of 'widget.customereditor'. once i've created shown instance of component both of following pieces of code seem getting reference same thing:

ext.componentquery.query('customereditor')[0]; ext.widget('customereditor'); 

the problem when try execute close method on returned object. following work , closes window:

ext.componentquery.query('customereditor')[0].close(); 

while not work:

ext.widget('customereditor').close(); 

i'm wondering difference between 2 ways of querying?

after reading api docs found answer. turns out ext.widget not query existing instance of component in dom instead creates new instances of components xtype. ext.componentquery should used find existing instances of components.


Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -