get vs select vs query for accessing elements with ext js framework
I am wondering why 'get' or 'select' methods are used in ext js when the dom query method 'query' seems to find everything get and select can find and more. 'get' for example finds elements by id, select finds elements by id, class, css selectors and query does everything. Why use get or select for 开发者_StackOverflow社区anything when query can do it?
The main differences...
Ext.select
This allows you to use a CSS selector to get a collection of Ext elements in the form of a CompositeElement
, allowing you to apply Ext.Element
methods on them in a group.
Ext.get
This fetches element(s) that match the ID provided, it cannot fetch Components.
Ext.query
This allows you to query using a CSS selector for items that match it.
I hope this explains the differences.
精彩评论