`

Ext.query与Ext.select的使用注意事项

    博客分类:
  • Ext
阅读更多
Ext.query和Ext.select的作用是一致的,都是Ext选择器,可以查找出一个或多个元素。区别在于返回类型上。分别是:query方法返回的是JavaScript标准的数组类型;select方法返回的是CompositeElement类型,试比较:

alter(Ext.isArray(this.query('a.BigClass')));  //true
alter(this.query('a.BigClass').length);

this.select('a.BigClass').each(function(i){
i.dom.href = 'javescript:void(0);'// 找到所有带有BigClass样式的A元素修改其链接
});


CompositeElement类型属于Ext自定义的类型,简单地说是以一个Ext.Element实例代表集合中多个元素,可实现 Element对象上所有的接口,也就是说CompositeElement在Ext中用于表示元素的集合中不论有多少个元素,均被视为一个单独元素处理,API中提供了each方法遍历其中的元素。它的用法和单个的Element对象没有不同。select方法返回的结果可直接如同Element般地操作,一般比query方法常用。


转自:http://book.51cto.com/art/200902/109279.htm
分享到:
评论

相关推荐

    Ext Js权威指南(.zip.001

    6.1.2 使用ext.query选择页面元素 / 215 6.1.3 基本选择符 / 223 6.1.4 属性选择符 / 229 6.1.5 css属性值选择符 / 234 6.1.6 伪类选择符 / 235 6.1.7 扩展选择器 / 248 6.1.8 ext.domquery的使用方法 / 249 ...

    Ext深入浅出 数据传输

    11.1.3 query函数和select函数.....260 11.1.4 encode函数和decode函数...263 11.1.5 extend函数.............................265 11.1.6 apply和applyIf函数..........266 11.1.7 namespace函数.....................

    精通JS脚本之ExtJS框架.part1.rar

    6.4.4 Ext.query与Ext.select 6.5 应用模板 6.5.1 Ext.Template 6.5.2 Ext.XTemplate 第7章 设计表单类布局 7.1 Form表单简介 7.1.1 Form表单的基本配置 7.1.2 ExtJS对Form表单的封装 7.2 ExtJS的表单组件 ...

    ExtJSWeb应用程序开发指南(第2版)

    6.2.4 Ext.query() 6.2.5 Ext.getCmp() 6.2.6 Ext.getDom() 6.2.7 Ext.isEmpty() 6.2.8 Ext.namespace() 6.2.9 Ext.each() 6.2.1 0Ext.apply() 6.2.1 1Ext.encode() 6.2.1 2Ext.htmlDecode...

    精通JS脚本之ExtJS框架.part2.rar

    6.4.4 Ext.query与Ext.select 6.5 应用模板 6.5.1 Ext.Template 6.5.2 Ext.XTemplate 第7章 设计表单类布局 7.1 Form表单简介 7.1.1 Form表单的基本配置 7.1.2 ExtJS对Form表单的封装 7.2 ExtJS的表单组件 ...

    EXTJS总结.txt

    Ext.fly('elId').appendChild(Ext.select('div')); 31.appendTo 把这个元素添加到送入的元素里面。 var el = Ext.get('elId1'); // 'elId'添加到'elId2'里面 Ext.fly('elId').appendTo('elId2'); Ext.fly('...

    天气预报,城市select联动,dwr,json

    天气预报,城市select联动,dwr,json 全国各省名称: http://www.weather.com.cn/data/list3/city.xml 全国城市: http://www.weather.com.cn/data/city3jdata/china.html 获得各省城市清单: ...获得各市城市清单: ...

    高性能服务框架ZYS.zip

    $data=$dbclient->query("select * from user"); $dbclient->close(); print_r($data); exit; 本地访问:http:/localhost/index/dbtest/ 数据库连接池多进程执行如下 swoole实现简单的视频...

    PHP连接MSSQL2005的扩展插件.

    最近帮朋友改一个小东西的时候才发现的,微软专门为PHP出了个SQL Server的扩展...另外需要注意的是,如果使用这个扩展连接Sql server 2005以上版本的sql server,你还需要在机器上先安装 SQL Server Native Client :...

    php.ini-development

    ;;;;;;;;... 1.... 2.... 3.... 4.... 5.... 6.... The syntax of the file is extremely simple.... Section headers (e.g.... at runtime.... There is no name validation.... (e.g.... previously set variable or directive (e.g....

    岳维功 ortp-realease.pdf

    这个值程序中使用默认时间值秒与 的乘积来表示。是不是计算过于简单了? 在最后 发送的一个包中记录的发送者发送的包总数。这个变量把这个值记录了下来。记 录这个值是为了实现协议中规定的:如果之前的包发送之后到...

    Linux下的rar解压缩工具

    ht[b|c] Select hash type [BLAKE2,CRC32] for file checksum id[c,d,p,q] Disable messages ierr Send all messages to stderr ilog[name] Log errors to file inul Disable all messages isnd Enable sound ...

    Bochs - The cross platform IA-32 (x86) emulator

    - GUI: select mouse capture toggle method in .bochsrc. - Ported most of Qemu's 'virtual VFAT' block driver (except runtime write support, but plus FAT32 suppport) - Added write protect option for ...

Global site tag (gtag.js) - Google Analytics