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
Post a Comment