使用ext js框架获取vs select vs query访问元素 [英] get vs select vs query for accessing elements with ext js framework
问题描述
主要区别...
Ext.select
这允许您使用CSS选择器以 CompositeElement
的形式获取Ext元素的集合,允许您应用 Ext.Element
一组中的方法。
Ext.get
提取与提供的ID匹配的元素,它不能获取组件。
Ext.query
这允许您使用CSS选择器进行查询对于符合它的项目。
我希望这可以解释差异。
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?
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.
这篇关于使用ext js框架获取vs select vs query访问元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!