get vs select vs query for accessing elements with ext js framework

放肆的年华 提交于 2019-12-11 02:45:43

问题


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 anything when query can do it?


回答1:


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.



来源:https://stackoverflow.com/questions/6350693/get-vs-select-vs-query-for-accessing-elements-with-ext-js-framework

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!